luacheck in main build

This commit is contained in:
NatureFreshMilk 2019-03-29 10:42:15 +01:00
parent d112bf4be7
commit 65651e5a78
8 changed files with 38 additions and 18 deletions

View File

@ -20,6 +20,13 @@ $(OUT_DIR):
mkdir $@ mkdir $@
$(MOD_ZIP): $(OUT_DIR) $(MOD_ZIP): $(OUT_DIR)
# lint with luacheck
sudo docker run --rm -it\
-v $(shell pwd)/mapserver_mod/mapserver:/app\
-w /app\
mapserver-builder\
luacheck .
# zip mod
zip -r $(OUT_DIR)/mapserver-mod.zip mapserver_mod zip -r $(OUT_DIR)/mapserver-mod.zip mapserver_mod
clean: clean:

View File

@ -1,9 +1,15 @@
FROM ubuntu:bionic FROM ubuntu:bionic
# cross compile stuff
RUN apt-get update &&\ RUN apt-get update &&\
apt-get install -y gcc-mingw-w64 gcc-5-arm-linux-gnueabihf gcc-i686-linux-gnu &&\ apt-get install -y gcc-mingw-w64 gcc-5-arm-linux-gnueabihf gcc-i686-linux-gnu &&\
apt-get install -y software-properties-common git apt-get install -y software-properties-common git
# go stuff
RUN add-apt-repository ppa:longsleep/golang-backports &&\ RUN add-apt-repository ppa:longsleep/golang-backports &&\
apt-get update &&\ apt-get update &&\
apt-get install -y golang-go apt-get install -y golang-go
# luacheck
RUN apt-get install -y luarocks liblua5.1-dev
RUN luarocks install luacheck

View File

@ -0,0 +1,24 @@
unused_args = false
allow_defined_top = true
globals = {
"mapserver",
"advtrains"
}
read_globals = {
-- Stdlib
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},
-- Minetest
"minetest",
"vector", "ItemStack",
"dump",
-- Deps
"unified_inventory", "default",
-- optional mods
"xban"
}

View File

@ -3,8 +3,6 @@ local last_index = 0
local last_name = "" local last_name = ""
local update_formspec = function(meta) local update_formspec = function(meta)
local inv = meta:get_inventory()
local name = meta:get_string("name") local name = meta:get_string("name")
local index = meta:get_string("index") local index = meta:get_string("index")
@ -68,8 +66,6 @@ minetest.register_node("mapserver:border", {
meta:set_int("index", index) meta:set_int("index", index)
end end
end end
else
-- non-owner
end end

View File

@ -12,7 +12,7 @@ local function explode(sep, input)
end end
local function get_max_lag() local function get_max_lag()
local arrayoutput = explode(", ",minetest.get_server_status()) local arrayoutput = explode(", ",minetest.get_server_status())
local arrayoutput = explode("=",arrayoutput[4]) arrayoutput = explode("=",arrayoutput[4])
return arrayoutput[1] return arrayoutput[1]
end end

View File

@ -1,7 +1,5 @@
local update_formspec = function(meta) local update_formspec = function(meta)
local inv = meta:get_inventory()
local text = meta:get_string("text") local text = meta:get_string("text")
local size = meta:get_string("size") local size = meta:get_string("size")
local direction = meta:get_string("direction") local direction = meta:get_string("direction")
@ -64,8 +62,6 @@ minetest.register_node("mapserver:label", {
meta:set_string("direction", fields.direction) meta:set_string("direction", fields.direction)
meta:set_string("size", fields.size) meta:set_string("size", fields.size)
end end
else
-- non-owner
end end

View File

@ -1,7 +1,5 @@
local update_formspec = function(meta) local update_formspec = function(meta)
local inv = meta:get_inventory()
local name = meta:get_string("name") local name = meta:get_string("name")
local category = meta:get_string("category") local category = meta:get_string("category")
local url = meta:get_string("url") or "" local url = meta:get_string("url") or ""
@ -64,8 +62,6 @@ minetest.register_node("mapserver:poi", {
meta:set_string("url", fields.url) meta:set_string("url", fields.url)
meta:set_string("category", fields.category) meta:set_string("category", fields.category)
end end
else
-- non-owner
end end

View File

@ -3,8 +3,6 @@ local last_index = 0
local last_line = "" local last_line = ""
local update_formspec = function(meta) local update_formspec = function(meta)
local inv = meta:get_inventory()
local line = meta:get_string("line") local line = meta:get_string("line")
local station = meta:get_string("station") local station = meta:get_string("station")
local index = meta:get_string("index") local index = meta:get_string("index")
@ -72,9 +70,6 @@ minetest.register_node("mapserver:train", {
meta:set_int("index", index) meta:set_int("index", index)
end end
end end
else
-- non-owner
end end