@@ -4,31 +4,76 @@ 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
- ## Styling and formatting
7
+ # Tools
8
8
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.
11
10
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
15
56
```
16
57
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 .
18
59
19
- ## Adding new actions
60
+ ``` sh
61
+ VIMRUNTIME=" /my/path/to/runtime" make check
62
+ ```
63
+
64
+ # Adding New Actions
20
65
21
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.
22
- Once you did, you should run the ` scripts/update-help.sh ` .
23
67
24
- ## Documentation
68
+ Once you did, you should run ` make help-update `
69
+
70
+ # Documentation
25
71
26
72
When 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 ` .
28
73
29
74
Documentation for options should also be added to ` nvim-tree-opts ` in ` doc/nvim-tree-lua.txt `
30
75
31
- ## Pull Request
76
+ # Pull Request
32
77
33
78
Please reference any issues in the description e.g. "resolves #1234 ".
34
79
0 commit comments