add luacheck, github action for luacheck, fix luacheck warnings, remove depreciated files

master
unknown 2022-08-21 21:07:34 -04:00
parent eec4fcdc54
commit caea107393
6 changed files with 56 additions and 8 deletions

18
.github/workflows/luacheck.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: luacheck
on: [push, pull_request]
jobs:
build:
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 ./

24
.luacheckrc Normal file
View File

@ -0,0 +1,24 @@
unused_args = false
allow_defined_top = true
exclude_files = {".luacheckrc"}
globals = {
"minetest", "core",
--mod provided
"abriglass",
}
read_globals = {
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},
--luac
"math", "table",
-- Builtin
"vector", "ItemStack", "dump", "DIR_DELIM", "VoxelArea", "Settings", "PcgRandom", "VoxelManip", "PseudoRandom",
--mod produced
}

View File

@ -15,7 +15,6 @@ local plain_colors = {
"green", "blue", "red", "yellow",
}
local i
for i in ipairs(plain_colors) do
local name = plain_colors[i]
local nodesuffix = 'glass_light_'..name
@ -38,7 +37,7 @@ end
-- undecorated coloured glass recipes
local dye_list = {
{"black", "black",},
{"black", "black",},
{"blue", "blue",},
{"cyan", "cyan",},
{"green", "green",},
@ -46,7 +45,7 @@ local dye_list = {
{"orange", "orange",},
{"purple", "violet",},
{"red", "red",},
{"yellow", "yellow",},
{"yellow", "yellow",},
{"frosted", "white",},
}
@ -137,7 +136,15 @@ minetest.register_craft({
-- cooking recipes
local cook_list = { "stainedglass_pattern01", "stainedglass_pattern02", "stainedglass_pattern03", "stainedglass_pattern04", "stainedglass_pattern05", "stainedglass_tiles_dark", "stainedglass_tiles_pale"}
local cook_list = {
"stainedglass_pattern01",
"stainedglass_pattern02",
"stainedglass_pattern03",
"stainedglass_pattern04",
"stainedglass_pattern05",
"stainedglass_tiles_dark",
"stainedglass_tiles_pale"
}
for i = 1, #cook_list do
local name = cook_list[i]

View File

@ -1,2 +0,0 @@
default
dye

View File

@ -1 +0,0 @@
Adds coloured glass, patterned stained glass, glass lights and one way windows.

View File

@ -1 +1,3 @@
name = abriglass
name = abriglass
depends = default, dye
description = Adds coloured glass, patterned stained glass, glass lights and one way windows.