From 1d0e134c40cdef7a625ecccad949e6c763b82efa Mon Sep 17 00:00:00 2001 From: Panquesito7 Date: Sun, 26 Apr 2020 20:34:51 -0500 Subject: [PATCH] Add GitHub workflow and LuaCheck --- .github/workflows/check-release.yml | 11 ++++++ .luacheckrc | 53 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/check-release.yml create mode 100644 .luacheckrc diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml new file mode 100644 index 0000000..fb2ee39 --- /dev/null +++ b/.github/workflows/check-release.yml @@ -0,0 +1,11 @@ +on: [push, pull_request] +name: Check & Release +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: lint + uses: Roang-zero1/factorio-mod-luacheck@master + with: + luacheckrc_url: https://raw.githubusercontent.com/minetest-mods/technic/master/.luacheckrc diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..f7c30d1 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,53 @@ +unused_args = false +allow_defined_top = true +max_line_length = 999 + +globals = { + "technic", "minetest", + "srcstack", +} + +read_globals = { + string = {fields = {"split", "trim"}}, + table = {fields = {"copy", "getn"}}, + + "intllib", "VoxelArea", + "default", "stairsplus", + + "PseudoRandom", "ItemStack", + "mg", "tubelib", "vector", + + "moretrees", "bucket", + "unified_inventory", "digilines", + + "pipeworks", "screwdriver", + "VoxelManip", "unifieddyes", + + "Settings", "mesecon", + "digiline_remote", + + "IsPlayerNodeOwner", "HasOwner", + "getLastOwner", "GetNodeOwnerName", + + "protector", "isprotect", + "homedecor_expect_infinite_stacks", +} + +files["concrete/init.lua"].ignore = { "steel_ingot" } +files["technic/machines/MV/lighting.lua"].read_globals = { "LIGHT_MAX" } +files["technic/machines/MV/tool_workshop.lua"].ignore = { "pos" } +files["technic/machines/other/frames.lua"].ignore = { "item_texture", "item_type", "adj", "connected", "" } +files["technic/machines/register/battery_box.lua"].ignore = { "pos", "tube_upgrade" } +files["technic/machines/register/cables.lua"].ignore = { "name", "from_below", "p" } +files["technic/machines/register/common.lua"].ignore = { "result" } + +files["technic/machines/register/generator.lua"].ignore = { "node" } +files["technic/machines/switching_station.lua"].ignore = { "pos1", "tier", "poshash" } +files["technic/radiation.lua"].ignore = { "LAVA_VISC" } +files["technic/tools/chainsaw.lua"].ignore = { "pos" } +files["technic/tools/flashlight.lua"].read_globals = { "LIGHT_MAX" } +files["technic/tools/mining_drill.lua"].ignore = { "mode" } +files["technic_chests/register.lua"].ignore = { "fs_helpers", "name", "locked_after_place" } + +files["technic_cnc/cnc.lua"].ignore = { "multiplier" } +files["wrench/init.lua"].ignore = { "name", "stack" }