@@ -4,52 +4,72 @@ Thank you for contributing.
4
4
5
5
See [ Development] ( https://github.com/nvim-tree/nvim-tree.lua/wiki/Development ) for environment setup, tips and tools.
6
6
7
+ # Tools
8
+
9
+ Following are used during CI and strongly recommended during local development.
10
+
11
+ Lint: [ luacheck] ( https://github.com/lunarmodules/luacheck/ )
12
+
13
+ Style: [ 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
+
7
19
# Quality
8
20
9
- The following quality checks are mandatory and are performed during CI:
21
+ The following quality checks are mandatory and are performed during CI. They run on the entire ` lua ` directory` return 1 on any failure.
10
22
11
- ## Styling and formatting
23
+ You can run them all via ` make ` or ` make all `
12
24
13
- Code is formatted using luacheck, and linted using stylua.
14
- You may install these via your package manager or with:
25
+ You can setup the git hooks by running ` scripts/setup-hooks.sh `
15
26
16
- ``` bash
17
- luarocks install luacheck
18
- cargo install stylua
27
+ ## lint
28
+
29
+ ``` sh
30
+ make lint
19
31
```
20
32
21
- Run:
33
+ 1 . Runs luacheck quietly using ` .luacheck ` settings
34
+ 1 . Runs ` scripts/doc-comments.sh ` to validate annotated documentation
35
+
36
+ ## style
37
+
38
+ Runs stylua using ` .stylua.toml ` settings:
39
+
22
40
``` sh
23
- stylua lua
24
- luacheck lua
41
+ make style
25
42
```
26
43
27
- You can setup the git hooks by running ` scripts/setup-hooks.sh ` .
44
+ You can automatically fix style issues via:
28
45
29
- ## Check
46
+ ``` sh
47
+ make style-fix
48
+ ```
49
+
50
+ ## check
30
51
31
- [ luals ] ( https://luals.github.io ) check is run with:
52
+ Runs the checks that the LSP lua language server runs inside nvim using ` .luarc.json `
32
53
33
54
``` sh
34
- scripts/luals- check.sh
55
+ make check
35
56
```
36
57
37
- Requires ` lua-language-server ` on your path .
58
+ Assumes ` $VIMRUNTIME ` is ` /usr/share/nvim/runtime ` . Adjust as necessary e.g .
38
59
39
- Assumes neovim's ` $VIMRUNTIME ` is ` "/usr/share/nvim/runtime" ` . Override with:
40
60
``` sh
41
- VIMRUNTIME=" /my/path/to/runtime" scripts/luals- check.sh
61
+ VIMRUNTIME=" /my/path/to/runtime" make check
42
62
```
43
63
44
- # Adding new actions
64
+ # Adding New Actions
45
65
46
66
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.
47
- Once you did, you should run the ` scripts/update-help.sh ` .
67
+
68
+ Once you did, you should run ` make update-help `
48
69
49
70
# Documentation
50
71
51
72
When adding new options, you should declare the defaults in the main ` nvim-tree.lua ` file.
52
- Once you did, you should run the ` scripts/update-help.sh ` .
53
73
54
74
Documentation for options should also be added to ` nvim-tree-opts ` in ` doc/nvim-tree-lua.txt `
55
75
0 commit comments