From 08f25d6ae1bb4a70805a1f8c12694df48122078d Mon Sep 17 00:00:00 2001 From: AFCMS <61794590+AFCMS@users.noreply.github.com> Date: Wed, 19 May 2021 19:11:45 +0200 Subject: [PATCH 1/4] add luacheck actions --- .github/workflows/main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..4f00f11 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,19 @@ +# This is a basic workflow to help you get started with Actions + +name: luacheck + +# Controls when the action will run. +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: +jobs: + luacheck: + runs-on: ubuntu-latest + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + - name: luacheck + uses: nebularg/actions-luacheck@v1.1.0 From e1f7ce11a75aa5634b63596e4a14c1a572247370 Mon Sep 17 00:00:00 2001 From: AFCMS <61794590+AFCMS@users.noreply.github.com> Date: Wed, 19 May 2021 19:13:15 +0200 Subject: [PATCH 2/4] add luacheck conf --- .luacheckrc | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .luacheckrc diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..408feb1 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,39 @@ +unused_args = false +allow_defined_top = true +max_line_length = 125 + +globals = { + "minetest", + mcl_death_messages = {fields = {"messages"}}, +} + +read_globals = { + string = {fields = {"split"}}, + table = {fields = {"copy", "getn", "shuffle"}}, + math = {fields = {"round"}}, + + -- Builtin + "vector", "ItemStack", + "dump", "DIR_DELIM", "VoxelArea", "Settings", + + -- MCL + -------------------------------------------- + -- CORE + "biomeinfo", "flowlib", "mcl_explosions", "mcl_sounds", "mcl_loot", "mcl_particles", "mcl_util", "mcl_worlds", "walkover", "mcl_colors", "mcl_autogroup", + -- ENTITIES + "mobs", "mobs_mc", + -- ENVIRONNEMENT + "lightning", "mcl_weather", + -- HELP + "mcl_craftguide", + -- HUD + "awards", "mcl_death_messages", "mcl_experience", "mcl_formspec", + -- ITEMS + "mcl_armor", "mcl_crafting_table", "mcl_buckets", "mcl_doors", "mcl_enchanting", "mcl_fire", + "mcl_potions", "mcl_throwing", "mcl_stairs", "screwdriver", "mesecon", "tnt", + -- PLAYER + "mcl_hunger", "playerphysics", "mcl_death_drop", "mcl_damage", + + --OTHER + "mcl_vars", +} From dc6c0e611eee2a5254c99882572851ce3da13e34 Mon Sep 17 00:00:00 2001 From: AFCMS <61794590+AFCMS@users.noreply.github.com> Date: Wed, 19 May 2021 19:15:40 +0200 Subject: [PATCH 3/4] fix some warnings --- kits.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kits.lua b/kits.lua index 99a1fb8..28b9690 100644 --- a/kits.lua +++ b/kits.lua @@ -4,12 +4,16 @@ HOW TO ADD KITS: kitpvp.api.register_kit({ name = agreatkitname, items = { - item(itemstr1, count, {enchantment1 = value, enchantment2 = value}), + item(itemstr1, count, {enchantment1 = value, enchantment2 = value}), item(itemstr2, count, {enchantment1 = value, enchantment2 = value}), item(itemstr3, count, {enchantment1 = value, enchantment2 = value}) }, armor = leather/chain/iron/gold/diamond/netherite, - armor_enchantments = {{enchantmentsforhelmet = value}, {enchantmentsforchestplate = value}, {enchantmentsforleggings = value}, {enchantmentsforboots = value}} + armor_enchantments = { + {enchantmentsforhelmet = value}, + {enchantmentsforchestplate = value}, + {enchantmentsforleggings = value}, + {enchantmentsforboots = value}}, }) ]] From 31b925f441730a19e252bd19d27ae09ca0ea909a Mon Sep 17 00:00:00 2001 From: AFCMS <61794590+AFCMS@users.noreply.github.com> Date: Wed, 19 May 2021 19:16:56 +0200 Subject: [PATCH 4/4] fix last warning --- api.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index f3f7f42..de46859 100644 --- a/api.lua +++ b/api.lua @@ -54,7 +54,8 @@ function kitpvp.api.register_kit(def) --local effects = def.effects -- Is $def completly filled in? - if not _def.name or not _def.items or not _def.armor or not _def.armor_enchantments or not _def.default_items then return end + if not _def.name or not _def.items or not _def.armor or not _def.armor_enchantments or + not _def.default_items then return end -- Register the kit kitpvp.kits[_def.name] = _def