@@ -5,11 +5,13 @@ This repository is a template for Neovim plugins written in Lua.
55The intention is that you use this template to create a new repository where you then adapt this readme and add your plugin code.
66The template includes the following:
77
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
1315- EditorConfig
1416- A .luacheckrc
1517
@@ -22,6 +24,11 @@ To get started writing a Lua plugin, I recommend reading `:help lua-guide` and
2224Anything that the majority of plugin authors will want to have is in scope of
2325this starter template. Anything that is controversial is out-of-scope.
2426
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.
2532
2633## Template License
2734
@@ -41,19 +48,36 @@ The remainder of the README is text that can be preserved in your plugin:
4148### Run tests
4249
4350
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+
4561You can then run:
4662
4763``` 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
4967```
5068
5169Or if you want to run a single test file:
5270
5371``` 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
5575```
5676
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