Enable luacheck

This commit is contained in:
Niklp 2023-12-10 14:08:23 +01:00 committed by SmallJoker
parent 1f9875fced
commit f1fdabe0b0
7 changed files with 29 additions and 24 deletions

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

@ -0,0 +1,10 @@
name: luacheck
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Luacheck
uses: lunarmodules/luacheck@master

View File

@ -1,20 +1,16 @@
unused_args = false
allow_defined_top = true
max_line_length = 140
read_globals = {
"doors",
"DIR_DELIM",
"minetest", "core",
"dump",
"vector", "nodeupdate",
"VoxelManip", "VoxelArea",
"PseudoRandom", "ItemStack",
"intllib",
"minetest",
"vector",
"default",
"armor",
"doors",
"stairs",
"stairsplus",
"mesecon",
}
globals = {
core = { fields = { "do_item_eat" }},
}
"mydoors"
}

View File

@ -7,7 +7,7 @@ local door_wood = { -- color, desc, image
{"yellow", "Clear Stained", "yellow"},
{"black", "Black", "black"},
}
local function my_door_wood_block_stairs(nodename, def)
local function my_door_wood_block_stairs(nodename, def)
local mod = string.match(nodename, "(.+):")
local name = string.match(nodename, ":(.+)")
minetest.register_node(nodename, def)
@ -23,22 +23,21 @@ local function my_door_wood_block_stairs(nodename, def)
sounds = def.sounds,
}
)
elseif minetest.get_modpath("stairs") then
elseif minetest.get_modpath("stairs") then
stairs.register_stair_and_slab(name,nodename,
def.groups,
def.tiles,
("%s Stair"):format(def.description),
("%s Slab"):format(def.description),
def.sounds
)
end
)
end
end
local function add_door(color, desc, img)
my_door_wood_block_stairs("my_door_wood:wood_"..color, {
description = desc.." Wood",
drawtype = "normal",
paramtype = "light",
tiles = {"mydoors_"..img.."_wood.png"},
paramtype = "light",
groups = {cracky = 2, choppy = 2, wood = 1},

View File

@ -40,7 +40,7 @@ local function add_door(col)
on_place = function(itemstack, placer, pointed_thing)
local pos1 = pointed_thing.above
local pos2 = vector.add(pos1, {x=0,y=1,z=0})
if not placer or not placer:is_player() then
return
end

View File

@ -33,7 +33,7 @@ local function add_door(doora, doorb, doorc, doord, num, des, recipe)
local function onplace(itemstack, placer, pointed_thing)
local pos1 = pointed_thing.above
local pos2 = vector.add(pos1, {x=0,y=1,z=0})
if not placer or not placer:is_player() then
return
end

View File

@ -34,7 +34,7 @@ minetest.register_node("my_garage_door:garage_door", {
on_place = function(itemstack, placer, pointed_thing)
local pos1 = pointed_thing.above
local pos2 = vector.add(pos1, {x=0,y=1,z=0})
if not placer or not placer:is_player() then
return
end
@ -75,7 +75,7 @@ minetest.register_node("my_garage_door:garage_door", {
local t1 = vector.add(above, dir)
local t2 = vector.add(t1, dir)
if not player or not player:is_player() then
return
end
@ -153,7 +153,7 @@ minetest.register_node("my_garage_door:garage_door_open", {
local t1 = vector.add(pos, dir)
local t2 = vector.subtract(t1, {x=0,y=1,z=0})
if not player or not player:is_player() then
return
end

View File

@ -41,7 +41,7 @@ local function add_door(col, des, tint, craft)
on_place = function(itemstack, placer, pointed_thing)
local pos1 = pointed_thing.above
local pos2 = vector.add(pos1, {x=0,y=1,z=0})
if not placer or not placer:is_player() then
return
end