luacheck and fixes

This commit is contained in:
BuckarooBanzay 2020-02-10 10:47:36 +01:00
parent f0dbeb255d
commit dcc46a9c6b
3 changed files with 50 additions and 6 deletions

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

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

20
.luacheckrc Normal file
View File

@ -0,0 +1,20 @@
unused_args = false
allow_defined_top = true
globals = {
"telemosaic"
}
read_globals = {
-- Stdlib
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},
-- Minetest
"minetest",
"vector", "ItemStack",
"dump",
-- Deps
"default"
}

View File

@ -81,7 +81,10 @@ local function extender_place(placepos, placer, itemstack, pointed_thing)
else
local count = math.ceil(dist - (C.beacon_range + extended))
minetest.chat_send_player(placer:get_player_name(), "You still need to add extensions for "..count.." nodes" )
minetest.chat_send_player(
placer:get_player_name(),
"You still need to add extensions for "..count.." nodes"
)
end
end
@ -229,7 +232,7 @@ function do_teleport(pos, player)
recent_teleports[name] = nil
end,
player_name)
else
-- else
-- beacon is in error, one way or another.
-- but don't swap it out - we won't get it back otherwise!
end
@ -403,7 +406,11 @@ for num, strength in ipairs(strengths) do
string.format('telemosaic_extender_%s.png^[colorize:%s', strength, c.value),
},
paramtype = 'light',
groups = { cracky = 2, [string.format('telemosaic_extender_%s', strength)] = 1, not_in_creative_inventory = 1 },
groups = {
cracky = 2,
[string.format('telemosaic_extender_%s', strength)] = 1,
not_in_creative_inventory = 1
},
after_place_node = extender_place,
after_dig_node = extender_dig,
})