From f49bc09de2600437be6e12c2ea93b676fd6347d5 Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Sun, 21 Aug 2022 21:22:15 -0400 Subject: [PATCH] add luacheck, add github action for luacheck, fix luacheck warnings, remove depreciated files --- .github/workflows/luacheck.yml | 18 ++++++++++++++++++ .luacheckrc | 24 ++++++++++++++++++++++++ depends.txt | 2 -- description.txt | 1 - init.lua | 8 ++++---- mod.conf | 4 +++- 6 files changed, 49 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..dd69dd3 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,24 @@ +unused_args = false +allow_defined_top = true + +exclude_files = {".luacheckrc"} + +globals = { + "minetest", "core", + + --mod provided +} + +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 + "default", +} \ No newline at end of file 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 0f1977b..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds faintly glowing coloured glass panes which can be used for stained glass windows or for gentle lighting. \ No newline at end of file diff --git a/init.lua b/init.lua index 837361d..c9e1656 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ -function register_pane(name, def) +local function register_pane(name, def) for i = 1, 15 do minetest.register_alias("xpanes:" .. name .. "_" .. i, "xpanes:" .. name .. "_flat") end @@ -66,9 +66,9 @@ end local panes_list = { {"white", "White", "ffffff", }, {"blue", "Blue", "0000FF", }, - {"cyan", "Cyan", "00FFFF", }, {"green", "Green", "00FF00", }, - {"magenta", "Magenta", "FF00FF", }, {"orange", "Orange", "FF6103", }, - {"violet", "Purple", "800080", }, {"red", "Red", "FF0000", }, + {"cyan", "Cyan", "00FFFF", }, {"green", "Green", "00FF00", }, + {"magenta", "Magenta", "FF00FF", }, {"orange", "Orange", "FF6103", }, + {"violet", "Purple", "800080", }, {"red", "Red", "FF0000", }, {"yellow", "Yellow", "FFFF00", }, } diff --git a/mod.conf b/mod.conf index 84658a1..9b56f99 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1,3 @@ -name = abripanes \ No newline at end of file +name = abripanes +depends = default, dye +description = Adds faintly glowing coloured glass panes which can be used for stained glass windows or for gentle lighting. \ No newline at end of file