mirror of
https://github.com/TimUntersberger/neogit
synced 2024-09-16 14:24:09 +02:00
change: switched from luacheck to selene
Installing luacheck on a windows machine is really annoying and I couldn't manage to install it. Also the library is no longer maintained.
This commit is contained in:
parent
c5c39a18b5
commit
4b8db40fe7
5 changed files with 23 additions and 34 deletions
21
.github/workflows/lint.yml
vendored
21
.github/workflows/lint.yml
vendored
|
@ -1,20 +1,17 @@
|
|||
name: Linting and style checking
|
||||
name: Linting
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
luacheck:
|
||||
name: Luacheck
|
||||
selene:
|
||||
name: selene
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Prepare
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo add-apt-repository universe
|
||||
sudo apt install luarocks -y
|
||||
sudo luarocks install luacheck
|
||||
|
||||
- name: Run Luacheck
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
- name: Install Selene
|
||||
run: cargo install selene
|
||||
- name: Run Selene
|
||||
run: make lint
|
||||
|
|
21
.luacheckrc
21
.luacheckrc
|
@ -1,21 +0,0 @@
|
|||
-- Rerun tests only if their modification time changed.
|
||||
cache = true
|
||||
|
||||
-- Glorious list of warnings: https://luacheck.readthedocs.io/en/stable/warnings.html
|
||||
ignore = {
|
||||
"212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off.
|
||||
"411", -- Redefining a local variable.
|
||||
"412", -- Redefining an argument.
|
||||
"422", -- Shadowing an argument
|
||||
"122", -- Indirectly setting a readonly global
|
||||
"431", -- (W431) shadowing upvalue
|
||||
"542", -- (W542) empty if branch
|
||||
"433", -- (W433) shadowing upvalue loop variable
|
||||
"421", -- (W421) shadowing definition of variable
|
||||
"611", -- (W611) line contains only whitespace
|
||||
}
|
||||
|
||||
-- Global objects defined by the C code
|
||||
read_globals = {
|
||||
"vim",
|
||||
}
|
5
Makefile
5
Makefile
|
@ -2,6 +2,9 @@ test:
|
|||
nvim --headless --noplugin -c "lua require(\"plenary.test_harness\").test_directory_command('tests/ {minimal_init = \"tests/minimal-init.nvim\"}')"
|
||||
|
||||
lint:
|
||||
luacheck `find -name "*.lua"` --codes
|
||||
selene --config selene/config.toml lua
|
||||
|
||||
lint-short:
|
||||
selene --config selene/config.toml --display-style Quiet lua
|
||||
|
||||
.PHONY: lint test
|
||||
|
|
4
selene/config.toml
Normal file
4
selene/config.toml
Normal file
|
@ -0,0 +1,4 @@
|
|||
std = "selene/globals"
|
||||
|
||||
[rules]
|
||||
shadowing = "allow"
|
6
selene/globals.toml
Normal file
6
selene/globals.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
[selene]
|
||||
base = "lua51"
|
||||
name = "globals"
|
||||
|
||||
[vim]
|
||||
any = true
|
Loading…
Reference in a new issue