From caea107393c79d01ac9079c2351d8ac7efdac74b Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Sun, 21 Aug 2022 21:07:34 -0400 Subject: [PATCH] add luacheck, github action for luacheck, fix luacheck warnings, remove depreciated files --- .github/workflows/luacheck.yml | 18 ++++++++++++++++++ .luacheckrc | 24 ++++++++++++++++++++++++ crafting.lua | 15 +++++++++++---- depends.txt | 2 -- description.txt | 1 - mod.conf | 4 +++- 6 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/luacheck.yml create mode 100644 .luacheckrc delete mode 100644 depends.txt delete mode 100644 description.txt diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml new file mode 100644 index 0000000..1d5241c --- /dev/null +++ b/.github/workflows/luacheck.yml @@ -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 ./ \ No newline at end of file diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..9aafd93 --- /dev/null +++ b/.luacheckrc @@ -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 +} \ No newline at end of file diff --git a/crafting.lua b/crafting.lua index e2d6f70..7822b0c 100644 --- a/crafting.lua +++ b/crafting.lua @@ -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] diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 2717bef..0000000 --- a/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -default -dye diff --git a/description.txt b/description.txt deleted file mode 100644 index 9648ac4..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds coloured glass, patterned stained glass, glass lights and one way windows. \ No newline at end of file diff --git a/mod.conf b/mod.conf index 7afc048..c9af789 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1,3 @@ -name = abriglass \ No newline at end of file +name = abriglass +depends = default, dye +description = Adds coloured glass, patterned stained glass, glass lights and one way windows. \ No newline at end of file