Skip to content

Commit 783ebaa

Browse files
authored
Initial commit
0 parents  commit 783ebaa

File tree

84 files changed

+14215
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+14215
-0
lines changed

.busted

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
return {
2+
_all = {
3+
coverage = false,
4+
lpath = "lua/?.lua;lua/?/init.lua;spec/?.lua",
5+
lua = "nlua",
6+
},
7+
default = {
8+
verbose = true,
9+
},
10+
tests = {
11+
verbose = true,
12+
},
13+
}

.dependencies/busted

Submodule busted added at 5ed85d0

.dependencies/luassert

Submodule luassert added at d3528bb

.dependencies/luvit-meta

Submodule luvit-meta added at ce76f6f
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/ColinKennedy/nvim-best-practices-plugin-template/discussions
5+
about: Use Github discussions instead

.github/ISSUE_TEMPLATE/bug_report.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Bug Report
2+
description: File a bug/issue
3+
title: "bug: "
4+
labels: [bug]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
**Before** reporting an issue, make sure to read the [documentation](https://github.com/ColinKennedy/nvim-best-practices-plugin-template)
10+
and search [existing issues](https://github.com/ColinKennedy/nvim-best-practices-plugin-template/issues) (even the [closed issues](https://github.com/ColinKennedy/nvim-best-practices-plugin-template/issues?q=is%3Aissue+is%3Aclosed))
11+
12+
Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/ColinKennedy/nvim-best-practices-plugin-template/discussions) and will be closed.
13+
- type: checkboxes
14+
attributes:
15+
label: Did you read the documentation and check existing issues?
16+
description: Make sure you checked and all of the below before submitting an issue
17+
options:
18+
- label: I have read all the [`:help plugin-template`](https://github.com/ColinKennedy/nvim-best-practices-plugin-template/blob/main/doc/my-template-docs.txt) documentation
19+
required: true
20+
- label: I have updated the plugin to the latest version before submitting this issue
21+
required: true
22+
- label: I have searched the [existing issues](https://github.com/ColinKennedy/nvim-best-practices-plugin-template/issues) and [closed issues](https://github.com/ColinKennedy/nvim-best-practices-plugin-template/issues?q=is%3Aissue+is%3Aclosed) issues
23+
required: true
24+
- type: input
25+
attributes:
26+
label: "Neovim version (nvim -v)"
27+
placeholder: "0.8.0 commit db1b0ee3b30f"
28+
validations:
29+
required: true
30+
- type: input
31+
attributes:
32+
label: "Operating system/version"
33+
placeholder: "Rocky 9"
34+
validations:
35+
required: true
36+
- type: textarea
37+
attributes:
38+
label: Describe the bug
39+
description: A clear and concise description of what the bug is. Please include any related errors you see in Neovim.
40+
validations:
41+
required: true
42+
- type: textarea
43+
attributes:
44+
label: Steps To Reproduce
45+
description: Steps to reproduce the behavior.
46+
placeholder: |
47+
1.
48+
2.
49+
3.
50+
validations:
51+
required: true
52+
- type: textarea
53+
attributes:
54+
label: Expected Behavior
55+
description: A concise description of what you expected to happen.
56+
validations:
57+
required: true
58+
- type: textarea
59+
attributes:
60+
label: Health
61+
description: Attach the output of `:checkhealth plugin_template` here
62+
render: log
63+
- type: textarea
64+
attributes:
65+
label: Log
66+
description: Please enable logging with `vim.g.plugin_template_configuration = {logging = {level = "debug", use_file = true}}` and attach the contents of `~/.local/share/nvim` here or call `:PluginTemplate copy-logs`
67+
render: log
68+
- type: textarea
69+
attributes:
70+
label: Repro
71+
description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua`
72+
value: |
73+
vim.env.LAZY_STDPATH = ".repro"
74+
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
75+
76+
require("lazy.minit").repro({
77+
spec = {
78+
{
79+
-- Add anything you need here (configuration, other plugins, etc)
80+
"ColinKennedy/nvim-best-practices-plugin-template",
81+
},
82+
})
83+
render: lua
84+
validations:
85+
required: false
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Feature Request
2+
description: Suggest a new feature
3+
title: "feature: "
4+
labels: [enhancement]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thank you for suggestion! Depending on your request, the issue may be reposted to https://github.com/nvim-neorocks/nvim-best-practices (which this plugin takes great inspiration). But please feel free to ask here first!
10+
- type: checkboxes
11+
attributes:
12+
label: Did you check the documentation?
13+
description: Make sure you read all the docs before submitting a feature request
14+
options:
15+
- label: I have read all the docs
16+
required: true
17+
- type: textarea
18+
validations:
19+
required: true
20+
attributes:
21+
label: Is your feature request related to a problem? Please describe.
22+
description: A clear and concise description of what the problem is. Ex. Wouldn't it be cool if [...] Ex. I'm always frustrated when [...]
23+
- type: textarea
24+
validations:
25+
required: true
26+
attributes:
27+
label: Describe the solution you'd like
28+
description: A clear and concise description of what you want to happen.
29+
- type: textarea
30+
validations:
31+
required: true
32+
attributes:
33+
label: Describe alternatives you've considered
34+
description: A clear and concise description of any alternative solutions or features you've considered.
35+
- type: textarea
36+
validations:
37+
required: false
38+
attributes:
39+
label: Additional context
40+
description: Add any other context or screenshots about the feature request here.

.github/workflows/.luarc.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"diagnostics.libraryFiles": "Disable",
3+
"runtime.version": "LuaJIT",
4+
"workspace.checkThirdParty": "Disable",
5+
"workspace.ignoreDir": [".lua", ".luarocks"],
6+
"workspace.library": [
7+
"$PWD/.dependencies/busted/library",
8+
"$PWD/.dependencies/luassert/library",
9+
"$PWD/.dependencies/luvit-meta/library",
10+
"$VIMRUNTIME/lua",
11+
"lua"
12+
]
13+
}

.github/workflows/commitlint.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Reference: https://commitlint.js.org/guides/ci-setup
2+
name: Commitlint
3+
4+
on: [pull_request]
5+
6+
jobs:
7+
commitlint:
8+
runs-on: ubuntu-latest
9+
name: Commitlint
10+
steps:
11+
- name: Run commitlint
12+
uses: opensource-nepal/commitlint@v1

.github/workflows/documentation.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
documentation:
10+
name: Documentation
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- uses: rhysd/action-setup-vim@v1
17+
with:
18+
neovim: true
19+
version: stable
20+
21+
- name: Create API Documentation
22+
run: |
23+
nvim --version
24+
make api_documentation
25+
26+
- name: Create User Documentation
27+
uses: kdheepak/panvimdoc@main
28+
with:
29+
vimdoc: plugin-template
30+
version: "Neovim >= 0.8.0"
31+
demojify: true
32+
treesitter: true
33+
34+
- name: Generate Tags
35+
run: |
36+
nvim -c 'helptags doc' -c 'quit'
37+
38+
- name: Push Changes
39+
uses: stefanzweifel/git-auto-commit-action@v5
40+
with:
41+
commit_message: "docs(vimdoc): Auto-generate user / API documentation + vimtags"
42+
commit_user_name: "github-actions[bot]"
43+
commit_user_email: "github-actions[bot]@users.noreply.github.com"
44+
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"

.github/workflows/llscheck.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: llscheck
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
llscheck:
14+
runs-on: ubuntu-latest
15+
name: llscheck
16+
17+
steps:
18+
- uses: actions/checkout@master
19+
with:
20+
submodules: true # Ensure submodules are checked out
21+
22+
- name: Update Submodules
23+
run: git submodule update --init --recursive
24+
25+
- uses: rhysd/action-setup-vim@v1
26+
# NOTE: We need Neovim installed in order to expose the $VIMRUNTIME
27+
# environment variable
28+
with:
29+
neovim: true
30+
version: stable
31+
32+
- uses: leafo/gh-actions-lua@v10
33+
with:
34+
# Neovim is compiled with LuaJIT so we might as well match. But it
35+
# doesn't look like we can match it exactly.
36+
#
37+
# Reference:
38+
# https://github.com/leafo/gh-actions-lua/issues/49#issuecomment-2295071198
39+
#
40+
luaVersion: "luajit-openresty"
41+
42+
- name: Install lua-language-server
43+
uses: jdx/mise-action@v2
44+
with:
45+
tool_versions: |
46+
lua-language-server latest
47+
48+
- uses: leafo/gh-actions-luarocks@v4
49+
- name: Install llscheck
50+
run: |
51+
luarocks install llscheck
52+
53+
- name: test
54+
run: |
55+
VIMRUNTIME=`nvim -l scripts/print_vimruntime_environment_variable.lua` llscheck --configpath .github/workflows/.luarc.json .

.github/workflows/luacheck.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Luacheck
2+
3+
on:
4+
pull_request: {}
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
luacheck:
11+
name: Luacheck
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Prepare
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y luarocks
20+
sudo luarocks install luacheck
21+
22+
- name: Lint
23+
run: make luacheck

.github/workflows/news.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Reference: https://github.com/neovim/neovim/blob/9762c5e3406cab8152d8dd161c0178965d841676/.github/workflows/news.yml
2+
name: Check news.txt
3+
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
7+
branches:
8+
- main
9+
10+
jobs:
11+
check:
12+
name: Check news.txt
13+
runs-on: ubuntu-latest
14+
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci:skip-news')
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
- name: news.txt needs to be updated
21+
run: |
22+
for commit in $(git rev-list HEAD~${{ github.event.pull_request.commits }}..HEAD); do
23+
message=$(git log -n1 --pretty=format:%s $commit)
24+
type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')"
25+
breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')"
26+
if [[ "$type" == "feat" ]] || [[ "$breaking" == "breaking-change" ]]; then
27+
! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet doc/news.txt ||
28+
{
29+
echo "
30+
Pull request includes a new feature or a breaking change, but
31+
news.txt hasn't been updated yet. This is just a reminder
32+
that news.txt may need to be updated. You can ignore this CI
33+
failure if you think the change won't be of interest to
34+
users."
35+
exit 1
36+
}
37+
fi
38+
done

.github/workflows/release-github.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# TODO: (you) - To enable this worflow, you must create a "Personal Access Token".
2+
#
3+
# References:
4+
# https://github.com/nvim-neorocks/sample-luarocks-plugin?tab=readme-ov-file#installing-release-please-recommended
5+
# Reference: https://github.com/nvim-neorocks/sample-luarocks-plugin?tab=readme-ov-file#generating-a-pat-personal-access-token
6+
#
7+
name: Release To GitHub
8+
9+
on:
10+
push:
11+
branches:
12+
- main
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
19+
jobs:
20+
release:
21+
name: Release To GitHub
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: googleapis/release-please-action@v4
25+
with:
26+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
27+
release-type: simple
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# TODO: (you) - To enable this workflow, you need to provide a LUAROCKS_API_KEY
2+
#
3+
# References:
4+
# https://github.com/nvim-neorocks/sample-luarocks-plugin?tab=readme-ov-file#publishing-to-luarocks
5+
# https://github.com/ellisonleao/nvim-plugin-template/blob/922c0d5249076416c5d84e7c0504f1154225a7ab/.github/workflows/release.yml
6+
#
7+
name: Release To LuaRocks
8+
9+
on:
10+
push:
11+
tags:
12+
- 'v*'
13+
14+
jobs:
15+
luarocks-upload:
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: LuaRocks Upload
20+
uses: nvim-neorocks/luarocks-tag-release@v7
21+
env:
22+
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}

0 commit comments

Comments
 (0)