Add GitHub actions and LuaCheck (#12)

* Add GitHub actions and LuaCheck

* Fix LuaCheck warnings
This commit is contained in:
David Leal 2020-10-26 13:28:49 -06:00 committed by GitHub
parent ebcdaa77fa
commit 11dcb3663b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 0 deletions

16
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: build
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Luarocks
run: |
sudo apt-get update -qyy
sudo apt-get install luarocks -qyy
- name: Install Luacheck
run: luarocks install --local luacheck
- name: Run Luacheck
run: $HOME/.luarocks/bin/luacheck .

21
.luacheckrc Normal file
View File

@ -0,0 +1,21 @@
unused_args = false
allow_defined_top = true
max_line_length = 999
globals = {
"ctf", "minetest",
"irc", "ctf_playertag",
"gauges",
}
read_globals = {
string = {fields = {"split", "trim"}},
table = {fields = {"copy", "getn"}},
"ctf_stats",
"filter",
}
files["server_chat/staff_channel.lua"].read_globals = { "table" }
files["spectator_mode/init.lua"].globals = { "ctf_map" }
files["spectator_mode/init.lua"].ignore = { "player" }