Add code linting with luacheck

With luacheck mistakes in Lua code can be found, e.g. the use of undefined variables, and the code style can be checked.
For the github workflow I copied Panquesito7's check-release.yml file.
This commit is contained in:
HybridDog 2021-01-17 12:52:08 +01:00
parent 7f7e928dd9
commit 98fdda4937
2 changed files with 23 additions and 0 deletions

15
.github/workflows/check-release.yml vendored Normal file
View File

@ -0,0 +1,15 @@
on: [push, pull_request]
name: Check & Release
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: apt
run: sudo apt-get install -y luarocks
- name: luacheck install
run: luarocks install --local luacheck
- name: luacheck run
run: $HOME/.luarocks/bin/luacheck ./

8
.luacheckrc Normal file
View File

@ -0,0 +1,8 @@
read_globals = {"minetest", "vector", "VoxelArea", "ItemStack",
"table",
"unified_inventory", "sfinv", "smart_inventory", "inventory_plus"
}
globals = {"worldedit"}
-- Ignore these errors until someone decides to fix them
ignore = {"113", "211", "212", "213", "311", "312", "411", "412", "421", "422",
"431", "432", "611", "614", "621", "631"}