1- *plugin-template.txt* For Neovim >= 0.8.0 Last change: 2025 April 06
1+ *plugin-template.txt* For Neovim >= 0.8.0 Last change: 2025 April 12
22
33==============================================================================
44Table of Contents *plugin-template-table-of-contents*
@@ -14,8 +14,13 @@ Table of Contents *plugin-template-table-of-contents*
14147. Tests | plugin-template-tests |
1515 - Initialization | plugin-template-tests-initialization |
1616 - Running | plugin-template-tests-running |
17- 8. Tracking Updates | plugin-template-tracking-updates |
18- 9. Other Plugins | plugin-template-other-plugins |
17+ 8. Coverage | plugin-template-coverage |
18+ - Setup | plugin-template-coverage-setup |
19+ - Running | plugin-template-coverage-running |
20+ - Viewing | plugin-template-coverage-viewing |
21+ 9. Tracking Updates | plugin-template-tracking-updates |
22+ 10. Other Plugins | plugin-template-other-plugins |
23+ 11. Links | plugin-template-links |
1924
2025==============================================================================
21261. A Neovim Plugin Template *plugin-template-a-neovim-plugin-template*
@@ -52,6 +57,7 @@ A template repository used to create Neovim plugins.
5257- RSS feed support <https://github.com/ColinKennedy/nvim-best-practices-plugin-template/commits/main/doc/news.txt.atom >
5358- Built-in logging to stdout / files
5459- Unittests use the full power of native busted <https://github.com/lunarmodules/busted >
60+ - Supports LuaCov <https://luarocks.org/modules/mpeterv/luacov > for coverage reports!
5561- Automated testing matrix supports 12 Neovim/OS combinations
5662 - neovim: `[v0.10.0, v0.11.0, stable, nightly]`
5763 - os: `[ubuntu-latest, macos-latest, windows-latest]`
@@ -274,7 +280,52 @@ Run test based on tags
274280
275281
276282==============================================================================
277- 8. Tracking Updates *plugin-template-tracking-updates*
283+ 8. Coverage *plugin-template-coverage*
284+
285+ Making sure that your plugin is well tested is important.
286+ `nvim- best- practices- plugin - template` can generate a per-line breakdown of
287+ exactly where your code is lacking tests using LuaCov
288+ <https://luarocks.org/modules/mpeterv/luacov >.
289+
290+
291+ SETUP *plugin-template-coverage-setup*
292+
293+ Make sure to install all dependencies for the unittests + coverage reporter if
294+ you have not installed them already.
295+
296+ >sh
297+ luarocks install busted --local
298+ luarocks install luacov --local
299+ luarocks install luacov-multiple --local
300+ <
301+
302+
303+ RUNNING *plugin-template-coverage-running*
304+
305+ >sh
306+ make coverage-html
307+ <
308+
309+ This will generate a `luacov.stats.out` & `luacov_html/` directory.
310+
311+
312+ VIEWING *plugin-template-coverage-viewing*
313+
314+ >sh
315+ (cd luacov_html && python -m http.server)
316+ <
317+
318+ If it worked, you should see a message like "Serving HTTP on 0.0.0.0 port 8000
319+ <http://0.0.0.0:8000 > …" Open `http:// 0.0 .0.0 :8000 /` in a browser like
320+ Firefox <https://www.mozilla.org/en-US/firefox > and you should see a view like
321+ this:
322+
323+ Just navigate down a few folders until you get to a .lua file and you’ll see
324+ a breakdown of your line coverage like this:
325+
326+
327+ ==============================================================================
328+ 9. Tracking Updates *plugin-template-tracking-updates*
278329
279330See doc/news.txt <doc/news.txt> for updates.
280331
@@ -286,13 +337,19 @@ You can watch this plugin for changes by adding this URL to your RSS feed:
286337
287338
288339==============================================================================
289- 9 . Other Plugins *plugin-template-other-plugins*
340+ 10 . Other Plugins *plugin-template-other-plugins*
290341
291342This template is full of various features. But if your plugin is only meant to
292343be a simple plugin and you don’t want the bells and whistles that this
293344template provides, consider instead using nvim-plugin-template
294345<https://github.com/ellisonleao/nvim-plugin-template >
295346
347+ ==============================================================================
348+ 11. Links *plugin-template-links*
349+
350+ 1. *Image*: https://github.com/user-attachments/assets/e5b30df8-036a-4886-81b9-affbf5c9e32a
351+ 2. *Image*: https://github.com/user-attachments/assets/c5420b16-4be7-4177-92c7-01af0b418816
352+
296353Generated by panvimdoc <https://github.com/kdheepak/panvimdoc >
297354
298355vim:tw=78:ts=8:noet:ft=help:norl:
0 commit comments