Add LuaCheck and fix warnings

This commit is contained in:
David Leal 2023-07-21 17:52:53 +00:00
parent be4df6fc88
commit bee20f6b52
3 changed files with 24 additions and 1 deletions

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

@ -0,0 +1,11 @@
on: [push, pull_request]
name: build
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: lint
uses: Roang-zero1/factorio-mod-luacheck@master
with:
luacheckrc_url: ""

13
.luacheckrc Normal file
View File

@ -0,0 +1,13 @@
unused_args = false
max_line_length = false
globals = {
"coloredwood"
}
read_globals = {
table = {fields = {"copy", "getn", "contains"}},
"minetest", "default",
"unifieddyes", "stairsplus",
}

View File

@ -28,7 +28,6 @@ local function is_stairsplus(name, colorized)
local class = string.sub(name, a+1, b-1) -- from colon to underscore is the class
local shape = ""
local rest
local colorshape
if class == "stair"