@@ -4,31 +4,76 @@ Thank you for contributing.
44
55See [ Development] ( https://github.com/nvim-tree/nvim-tree.lua/wiki/Development ) for environment setup, tips and tools.
66
7- ## Styling and formatting
7+ # Tools
88
9- Code is formatted using luacheck, and linted using stylua.
10- You can install these with:
9+ Following are used during CI and strongly recommended during local development.
1110
12- ``` bash
13- luarocks install luacheck
14- cargo install stylua
11+ Lint: [ luacheck] ( https://github.com/lunarmodules/luacheck/ )
12+
13+ Style: [ StyLua] ( https://github.com/JohnnyMorganz/StyLua )
14+
15+ Language server: [ luals] ( https://luals.github.io )
16+
17+ You can install them via you OS package manager e.g. ` pacman ` , ` brew ` or other via other package managers such as ` cargo ` or ` luarocks `
18+
19+ # Quality
20+
21+ The following quality checks are mandatory and are performed during CI. They run on the entire ` lua ` directory and return 1 on any failure.
22+
23+ You can run them all via ` make ` or ` make all `
24+
25+ You can setup git hooks to run all checks by running ` scripts/setup-hooks.sh `
26+
27+ ## lint
28+
29+ 1 . Runs luacheck quietly using ` .luacheck ` settings
30+
31+ ``` sh
32+ make lint
33+ ```
34+
35+ ## style
36+
37+ 1 . Runs stylua using ` .stylua.toml ` settings
38+ 1 . Runs ` scripts/doc-comments.sh ` to validate annotated documentation
39+
40+ ``` sh
41+ make style
42+ ```
43+
44+ You can automatically fix stylua issues via:
45+
46+ ``` sh
47+ make style-fix
48+ ```
49+
50+ ## check
51+
52+ 1 . Runs the checks that the LSP lua language server runs inside nvim using ` .luarc.json ` via ` scripts/luals-check.sh `
53+
54+ ``` sh
55+ make check
1556```
1657
17- You can setup the git hooks by running ` scripts/setup-hooks.sh ` .
58+ Assumes ` $VIMRUNTIME ` is ` /usr/share/nvim/runtime ` . Adjust as necessary e.g .
1859
19- ## Adding new actions
60+ ``` sh
61+ VIMRUNTIME=" /my/path/to/runtime" make check
62+ ```
63+
64+ # Adding New Actions
2065
2166To 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.
22- Once you did, you should run the ` scripts/update-help.sh ` .
2367
24- ## Documentation
68+ Once you did, you should run ` make help-update `
69+
70+ # Documentation
2571
2672When adding new options, you should declare the defaults in the main ` nvim-tree.lua ` file.
27- Once you did, you should run the ` scripts/update-help.sh ` .
2873
2974Documentation for options should also be added to ` nvim-tree-opts ` in ` doc/nvim-tree-lua.txt `
3075
31- ## Pull Request
76+ # Pull Request
3277
3378Please reference any issues in the description e.g. "resolves #1234 ".
3479
0 commit comments