From 92ee7e419ee2c3aaec0c9b7f20dff4f18d9b58ed Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Sun, 28 Nov 2021 01:28:44 -0500 Subject: [PATCH] add luacheck, fix errors, add github actions --- .github/workflows/luacheck.yml | 18 ++++++++++++++++++ .luacheckrc | 25 +++++++++++++++++++++++++ computers/.luacheckrc | 21 --------------------- home_workshop_misc/init.lua | 4 ++-- 4 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/luacheck.yml create mode 100644 .luacheckrc delete mode 100644 computers/.luacheckrc 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..91c274f --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,25 @@ +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", "screwdriver", "unifieddyes", "computers", +} \ No newline at end of file diff --git a/computers/.luacheckrc b/computers/.luacheckrc deleted file mode 100644 index 5683942..0000000 --- a/computers/.luacheckrc +++ /dev/null @@ -1,21 +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", - "unifieddyes", - "screwdriver", -} - -globals = { -} - diff --git a/home_workshop_misc/init.lua b/home_workshop_misc/init.lua index ed99009..059ffab 100644 --- a/home_workshop_misc/init.lua +++ b/home_workshop_misc/init.lua @@ -79,7 +79,7 @@ minetest.register_node("home_workshop_misc:beer_mug", { sounds = default.node_sound_glass_defaults(), selection_box = beer_cbox, on_use = function(itemstack, user, pointed_thing) - if not creative.is_enabled_for(user:get_player_name()) then + if not minetest.is_creative_enabled_for(user:get_player_name()) then minetest.do_item_eat(2, "vessels:drinking_glass 1", itemstack, user, pointed_thing) return itemstack end @@ -116,7 +116,7 @@ minetest.register_node("home_workshop_misc:soda_machine", { minetest.sound_play("insert_coin", { pos=pos, max_hear_distance = 5 }) - if not creative.is_enabled_for(playername) then + if not minetest.is_creative_enabled_for(playername) then wielditem:take_item() clicker:set_wielded_item(wielditem) return wielditem