From 2356e3d77c38a59a37ad0eb274e61db4cb28b1f5 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sat, 9 Dec 2023 14:11:06 +1100 Subject: [PATCH] ci: add quality to contributing --- CONTRIBUTING.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ceeec034..22d5f9e0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,31 +4,51 @@ Thank you for contributing. See [Development](https://github.com/nvim-tree/nvim-tree.lua/wiki/Development) for environment setup, tips and tools. +# Quality + +The following quality checks are mandatory and are performed during CI: + ## Styling and formatting Code is formatted using luacheck, and linted using stylua. -You can install these with: +You may install these via your package manager or with: ```bash luarocks install luacheck cargo install stylua ``` +Run: +```sh +stylua lua +luacheck lua +``` + You can setup the git hooks by running `scripts/setup-hooks.sh`. -## Adding new actions +## Check + +[luals](https://luals.github.io) check is run with: + +```sh +scripts/luals-check.sh +``` + +Requires `lua-language-server` on your path. + +# Adding new actions To add a new action, add a file in `actions/name-of-the-action.lua`. You should export a `setup` function if some configuration is needed. Once you did, you should run the `scripts/update-help.sh`. -## Documentation +# Documentation When adding new options, you should declare the defaults in the main `nvim-tree.lua` file. Once you did, you should run the `scripts/update-help.sh`. Documentation for options should also be added to `nvim-tree-opts` in `doc/nvim-tree-lua.txt` -## Pull Request +# Pull Request Please reference any issues in the description e.g. "resolves #1234".