From 7f1cf733c5d121f56162c48ce3f4fd8d05b4e215 Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Sun, 1 May 2022 17:09:15 -0400 Subject: [PATCH] add github luacheck workflow and various luacheck fixes --- .github/.workflows/luacheck.yml | 11 +++++++++++ homedecor_tables/.luacheckrc | 20 -------------------- homedecor_tables/misc.lua | 6 +++--- homedecor_tables/mod.conf | 4 ++-- homedecor_wardrobe/init.lua | 2 +- 5 files changed, 17 insertions(+), 26 deletions(-) create mode 100644 .github/.workflows/luacheck.yml delete mode 100644 homedecor_tables/.luacheckrc diff --git a/.github/.workflows/luacheck.yml b/.github/.workflows/luacheck.yml new file mode 100644 index 00000000..4c654d08 --- /dev/null +++ b/.github/.workflows/luacheck.yml @@ -0,0 +1,11 @@ + +name: luacheck +on: [push, pull_request] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: Roang-zero1/factorio-mod-luacheck@master + with: + luacheckrc_url: "" \ No newline at end of file diff --git a/homedecor_tables/.luacheckrc b/homedecor_tables/.luacheckrc deleted file mode 100644 index 4f0848c8..00000000 --- a/homedecor_tables/.luacheckrc +++ /dev/null @@ -1,20 +0,0 @@ -unused_args = false -allow_defined_top = true -max_comment_line_length = 999 - -read_globals = { - "DIR_DELIM", - "minetest", "core", - "unpack", - "dump", - table = { fields = { "copy", "getn" } }, - "vector", "nodeupdate", - "VoxelManip", "VoxelArea", - "PseudoRandom", "ItemStack", - "default", - "homedecor", -} - -globals = { -} - diff --git a/homedecor_tables/misc.lua b/homedecor_tables/misc.lua index 6fa331db..fa618f89 100644 --- a/homedecor_tables/misc.lua +++ b/homedecor_tables/misc.lua @@ -19,7 +19,7 @@ local tabletop_materials = { } } -leg_materials = { +local leg_materials = { { "brass", S("brass") }, { "wrought_iron", S("wrought iron") }, { "wood", S("wood") } @@ -55,7 +55,7 @@ local tables_cbox = { } for i, mat in ipairs(tabletop_materials) do - local m, small_s, small_r, large = unpack(mat) + local m = unpack(mat) local s if m == "glass" then @@ -101,7 +101,7 @@ for i, mat in ipairs(tabletop_materials) do }) for _, l in ipairs(leg_materials) do - local leg_mat, desc = unpack(l) + local leg_mat = unpack(l) homedecor.register(string.format("%s_table_%s_with_%s_legs", m, shape, leg_mat), { description = string.format("%s %s table with %s legs", shape, m, leg_mat), diff --git a/homedecor_tables/mod.conf b/homedecor_tables/mod.conf index 32011ac5..858b8e68 100644 --- a/homedecor_tables/mod.conf +++ b/homedecor_tables/mod.conf @@ -1,4 +1,4 @@ name = homedecor_tables description = Homedecor mod: tables -depends = homedecor_common, default, basic_materials -optional_depends = creative +depends = homedecor_common +optional_depends = creative, default, basic_materials diff --git a/homedecor_wardrobe/init.lua b/homedecor_wardrobe/init.lua index a800bd7a..75b6e171 100644 --- a/homedecor_wardrobe/init.lua +++ b/homedecor_wardrobe/init.lua @@ -1,7 +1,7 @@ if not minetest.get_modpath("player_api") then return end local S = minetest.get_translator("homedecor_wardrobe") -modpath = minetest.get_modpath("homedecor_wardrobe") +local modpath = minetest.get_modpath("homedecor_wardrobe") local wd_cbox = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5}}