mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
Add style-check script
This commit is contained in:
parent
ab1916f385
commit
27d7a0ffff
4 changed files with 23 additions and 1 deletions
|
|
@ -8,4 +8,4 @@ before_install:
|
|||
- sudo luarocks install luacheck
|
||||
|
||||
script:
|
||||
- luacheck **/**/*.lua --codes
|
||||
- ./scripts/style-check.sh
|
||||
|
|
|
|||
|
|
@ -11,6 +11,18 @@ As you know, `nvim-treesitter` is roughly splitted in two parts :
|
|||
|
||||
Depending on which part of the plugin you want to contribute to, please read the appropriate section.
|
||||
|
||||
## Style Checks and Tests
|
||||
|
||||
We haven't implemented any functionality tests yet. Feel free to contribute.
|
||||
However, we check code style with `luacheck`!
|
||||
Please install luacheck and activate our `pre-push` hook to automatically check style before
|
||||
every push:
|
||||
|
||||
```bash
|
||||
luarocks install luacheck
|
||||
ln -s ../../scripts/pre-push .git/hooks/pre-push
|
||||
```
|
||||
|
||||
## Parser configurations
|
||||
|
||||
Contributing to parser configurations is basically modifying one of the `queries/*/*.scm`.
|
||||
|
|
|
|||
7
scripts/pre-push
Executable file
7
scripts/pre-push
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Can be used as a pre-push hook
|
||||
# Just symlink this file to .git/hooks/pre-push
|
||||
|
||||
echo "Running style check..."
|
||||
./scripts/style-check.sh
|
||||
3
scripts/style-check.sh
Executable file
3
scripts/style-check.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
luacheck `find -name "*.lua"` --codes
|
||||
Loading…
Add table
Add a link
Reference in a new issue