@@ -5,11 +5,13 @@ This repository is a template for Neovim plugins written in Lua.
5
5
The intention is that you use this template to create a new repository where you then adapt this readme and add your plugin code.
6
6
The template includes the following:
7
7
8
- - GitHub workflows to run linters and tests
9
- - Packaging of tagged releases and upload to [ LuaRocks] ( https://luarocks.org/ )
10
- if a [ ` LUAROCKS_API_KEY ` ] ( https://luarocks.org/settings/api-keys ) is added
11
- to the [ GitHub Actions secrets] ( https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository )
12
- - Minimal test setup
8
+ - GitHub workflows and configurations to run linters and tests
9
+ - Packaging of tagged releases and upload to [ LuaRocks] [ luarocks ]
10
+ if a [ ` LUAROCKS_API_KEY ` ] [ luarocks-api-key ] is added
11
+ to the [ GitHub Actions secrets] [ gh-actions-secrets ]
12
+ - Minimal test setup:
13
+ - A ` scm ` [ rockspec] [ rockspec-format ] , ` nvim-lua-plugin-scm-1.rockspec `
14
+ - A ` .busted ` file
13
15
- EditorConfig
14
16
- A .luacheckrc
15
17
@@ -22,6 +24,11 @@ To get started writing a Lua plugin, I recommend reading `:help lua-guide` and
22
24
Anything that the majority of plugin authors will want to have is in scope of
23
25
this starter template. Anything that is controversial is out-of-scope.
24
26
27
+ ## Usage
28
+
29
+ - Click [ Use this template] [ use-this-template ] . Do not fork.
30
+ - Rename ` nvim-lua-plugin-scm-1.rockspec ` and change the ` package ` name
31
+ to the name of your plugin.
25
32
26
33
## Template License
27
34
@@ -41,19 +48,36 @@ The remainder of the README is text that can be preserved in your plugin:
41
48
### Run tests
42
49
43
50
44
- Running tests requires [ plenary.nvim] [ plenary ] to be checked out in the parent directory of * this* repository.
51
+ Running tests requires either
52
+
53
+ - [ luarocks] [ luarocks ]
54
+ - or [ busted] [ busted ] and [ nlua] [ nlua ]
55
+
56
+ to be installed[ ^ 1 ] .
57
+
58
+ [ ^ 1 ] : The test suite assumes that ` nlua ` has been installed
59
+ using luarocks into ` ~/.luarocks/bin/ ` .
60
+
45
61
You can then run:
46
62
47
63
``` bash
48
- nvim --headless --noplugin -u tests/minimal.vim -c " PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.vim'}"
64
+ luarocks test --local
65
+ # or
66
+ busted
49
67
```
50
68
51
69
Or if you want to run a single test file:
52
70
53
71
``` bash
54
- nvim --headless --noplugin -u tests/minimal.vim -c " PlenaryBustedDirectory tests/path_to_file.lua {minimal_init = 'tests/minimal.vim'}"
72
+ luarocks test spec/path_to_file.lua --local
73
+ # or
74
+ busted spec/path_to_file.lua
55
75
```
56
76
57
-
58
- [ nvim-lua-guide ] : https://github.com/nanotee/nvim-lua-guide
59
- [ plenary ] : https://github.com/nvim-lua/plenary.nvim
77
+ [ rockspec-format ] : https://github.com/luarocks/luarocks/wiki/Rockspec-format
78
+ [ luarocks ] : https://luarocks.org
79
+ [ luarocks-api-key ] : https://luarocks.org/settings/api-keys
80
+ [ gh-actions-secrets ] : https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository
81
+ [ busted ] : https://lunarmodules.github.io/busted/
82
+ [ nlua ] : https://github.com/mfussenegger/nlua
83
+ [ use-this-template ] : https://github.com/new?template_name=nvim-lua-plugin-template&template_owner=nvim-lua
0 commit comments