Skip to content

Commit

Permalink
feat(base): implement plugin template
Browse files Browse the repository at this point in the history
  • Loading branch information
pysan3 committed Nov 13, 2023
1 parent 5726767 commit 879d350
Show file tree
Hide file tree
Showing 28 changed files with 632 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .busted
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
_all = {
coverage = false,
lpath = "lua/?.lua;lua/?/init.lua",
},
default = {
verbose = true,
},
tests = {
verbose = true,
},
}
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*.{lua,md,hs,nix}]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Bug Report
description: Report a problem in Neorg
labels: [bug]
body:

- type: checkboxes
id: faq-prerequisite
attributes:
label: Prerequisites
options:
- label: I am using the latest stable release of Neovim
required: true
- label: I am using the latest version of the plugin
required: true

- type: input
attributes:
label: "Neovim Version"
description: "`nvim --version`:"
validations:
required: true

- type: textarea
attributes:
label: "Actual behavior"
description: "A description of actual behavior. Extra points if it includes images or videos."
validations:
required: true

- type: textarea
attributes:
label: "Expected behavior"
description: "A description of the behavior you expected."
validations:
required: true

- type: textarea
attributes:
label: "Other information"
description: "Other information that could be helpful with debugging."

- type: dropdown
id: help
attributes:
label: "Help"
description: "Would you be able to resolve this issue by submitting a pull request?"
options:
- "Yes"
- "Yes, but I don't know how to start. I would need guidance (check question below)"
- "No"

- type: textarea
attributes:
label: "Implementation help"
description: "If you selected yes in the last question please specify what you would need help with in order to resolve the issue."

3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
contact_links:
- name: Ask a question
about: If you need help with configuration or something else
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Feature request
description: Request a feature for Neorg
labels: [feature]
body:

- type: checkboxes
id: issue-prerequisite
attributes:
label: Issues
options:
- label: I have checked [existing issues](https://github.com/pysan3/pathlib.nvim/issues?q=is%3Aissue) and there are no existing ones with the same request.
required: true

- type: textarea
attributes:
label: "Feature description"
validations:
required: true

- type: dropdown
id: help
attributes:
label: "Help"
description: "Would you be able to implement this by submitting a pull request?"
options:
- "Yes"
- "Yes, but I don't know how to start. I would need guidance"
- "No"
validations:
required: true

- type: textarea
attributes:
label: "Implementation help"
description: "If you selected yes in the last question please specify in detail what you would need help with in order to implement this."
validations:
required: false
31 changes: 31 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: generate-docs

on:
push:
branches-ignore:
- main

jobs:
docs:
name: Generate docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23

- name: Generating docs
run: nix run ".#docgen"

- name: Update documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_MSG: |
docs(generated): update doc/pathlib.nvim.txt
skip-checks: true
run: |
git config user.email "actions@github"
git config user.name "Github Actions"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git add doc/
# Only commit and push if we have changes
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF})
22 changes: 22 additions & 0 deletions .github/workflows/lua_ls-typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: lua_ls-typecheck
on:
pull_request: ~
push:
branches:
- '*'

jobs:
build:
name: Type Check Code Base
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Type Check Code Base
uses: mrcjkb/[email protected]
with:
directories: |
lua
tests
42 changes: 42 additions & 0 deletions .github/workflows/luarocks-tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: luarocks-tag-release

on:
push:
release:
types:
- created
tags:
- '*'
workflow_dispatch:

jobs:
luarocks-upload:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to count the commits
- name: Get Version
run: echo "LUAROCKS_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v5
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:
summary: "OS Independent, ultimate solution to path handling in neovim."
detailed_description: |
This plugin aims to decrease the difficulties of path management across mutliple OSs.
The plugin API is heavily inspired by Python's `pathlib.Path` with tweaks to fit neovim usage.
It is mainly used in neo-tree.nvim but it is as simple as you can use it in your own configs!
version: ${{ env.LUAROCKS_VERSION }}
labels: |
neovim
nvim
pathlib
os
test_interpreters:
neovim-stable
neovim-nightly
copy_directories: |
{{ neovim.plugin.dirs }}
doc
26 changes: 26 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: release-please

on:
push:
branches:
- main
workflow_run:
workflows:
- lua_ls-typecheck
- stylua
types:
- complete

permissions:
contents: write
pull-requests: write

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: simple
package-name: pathlib.nvim
49 changes: 49 additions & 0 deletions .github/workflows/stylua.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: stylua

on:
push:
branches:
- '*'
paths-ignore:
- ".github/**"
- "**.md"
- "**.norg"

jobs:
format-with-stylua:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache cargo modules
id: cache-cargo
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.cargo
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install cargo
run: curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Install stylua
run: cargo install stylua --features lua51

- name: Run formatting
run: stylua -v --verify .

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore: autoformat with stylua"
branch: ${{ github.ref }}

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,10 @@ luac.out
*.x86_64
*.hex

# Luarocks testing files
/luarocks
/lua_modules
/.luarocks
/lua

!/lua
10 changes: 10 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ignore = {
"631", -- max_line_length
"122", -- read-only field of global variable
}
read_globals = {
"vim",
"describe",
"it",
"assert"
}
7 changes: 7 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.diagnostics.globals": [
"vim"
],
"workspace.checkThirdParty": false
}
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# pathlib.nvim
Ultimate solution to path handling in neovim. OS Independent.
``` document.meta
title: README
description:
authors: takuto
categories:
created: 2023-11-14
updated: 2023-11-14T01:17:18+0900
version: 1.1.1
```
``` embed
<div align="center">
<h1>pathlib.nvim</h1>
<p>
<strong>
OS Independent, ultimate solution to path handling in neovim.
</strong>
</p>
</div>
```

# `pathlib.nvim`

This plugin aims to decrease the difficulties of path management across
mutliple OSs. The plugin API is heavily inspired by Python's
`pathlib.Path` with tweaks to fit neovim usage. It is mainly used in
[neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) but it
is as simple as you can use it in your own configs!

[![Neovim](https://img.shields.io/badge/NeoVim-%2357A143.svg?&style=for-the-badge&logo=neovim&logoColor=white)](https://neovim.io/)
[![Lua](https://img.shields.io/badge/lua-%232C2D72.svg?style=for-the-badge&logo=lua&logoColor=white)](https://www.lua.org/)

[![MLP-2.0](https://img.shields.io/github/license/pysan3/pathlib.nvim.svg?style=for-the-badge)](https://github.com/pysan3/pathlib.nvim/blob/master/LICENSE)
[![Issues](https://img.shields.io/github/issues/pysan3/pathlib.nvim.svg?style=for-the-badge)](https://github.com/pysan3/pathlib.nvim/issues)
[![Build
Status](https://img.shields.io/github/actions/workflow/status/pysan3/pathlib.nvim/release-please.yml?style=for-the-badge)](https://github.com/pysan3/pathlib.nvim/actions/workflows/release-please.yml)
[![LuaRocks](https://img.shields.io/luarocks/v/pysan3/pathlib.nvim?logo=lua&color=purple&style=for-the-badge)](https://luarocks.org/modules/pysan3/pathlib.nvim)

# Other Projects

- Python `pathlib`

- <https://docs.python.org/3/library/pathlib.html>
Loading

0 comments on commit 879d350

Please sign in to comment.