From 08b7f60db92829e4f16917d4fa524c6fc2116625 Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Sun, 21 Aug 2022 21:48:37 -0400 Subject: [PATCH] add luacheck, add github actions luacheck, fix luacheck warnings, remove depreciated files --- .github/workflows/luacheck.yml | 18 ++++++++++++++++++ .luacheckrc | 25 +++++++++++++++++++++++++ README.md | 2 +- depends.txt | 3 --- description.txt | 1 - init.lua | 8 +++----- mod.conf | 4 +++- 7 files changed, 50 insertions(+), 11 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..6577131 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,25 @@ +unused_args = false +allow_defined_top = true + +exclude_files = {".luacheckrc"} + +globals = { + "minetest", "core", + + --mod provided + "abriflame", +} + +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/README.md b/README.md index bd487c1..ec7ef62 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Coloured flames Minetest mod by Shara RedCat which adds: 1. Ten decorative, non-destructive fire types. 2. A fire starter tool to create them. -Note: This mod depends on [abriglass](https://github.com/Ezhh/abriglass) and will not work without it. +Note: This mod depends on [abriglass](https://github.com/mt-mods/abriglass) and will not work without it. Crafting diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 3b14c09..0000000 --- a/depends.txt +++ /dev/null @@ -1,3 +0,0 @@ -default -fire -abriglass \ No newline at end of file diff --git a/description.txt b/description.txt deleted file mode 100644 index 2f507ac..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds coloured fire through use of fire starter tool. \ No newline at end of file diff --git a/init.lua b/init.lua index 7600517..a8ea88e 100644 --- a/init.lua +++ b/init.lua @@ -14,9 +14,7 @@ local function smoke(pos, node, clicker, enable) return end - local node = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name - - if node ~= "air" or particle ~= 0 then + if minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name ~= "air" or particle ~= 0 then return end @@ -106,8 +104,8 @@ minetest.register_tool("abriflame:flint", { return itemstack end - local pos = ({x = pointed_thing.under.x, - y = pointed_thing.under.y + 1, + local pos = ({x = pointed_thing.under.x, + y = pointed_thing.under.y + 1, z = pointed_thing.under.z}) if minetest.get_node(pos).name ~= "air" or diff --git a/mod.conf b/mod.conf index b455176..ad27d9c 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1,3 @@ -name = abriflame \ No newline at end of file +name = abriflame +depends = default, fire, abriglass +description = Adds coloured fire through use of fire starter tool. \ No newline at end of file