From 8d85362b5c2f46c6da209d0121d0f8f4a8cfef0e Mon Sep 17 00:00:00 2001 From: David Leal Date: Sun, 18 Jun 2023 00:20:46 -0600 Subject: [PATCH] Add Continuous Integration and LuaCheck (#2) All warnings have been fixed as well. You can verify all is fine by checking the workflow run. --- .github/workflows/build.yml | 11 +++++++++++ .luacheckrc | 12 ++++++++++++ init.lua | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml create mode 100644 .luacheckrc diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..817e409 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,11 @@ +on: [push, pull_request] +name: build +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: lint + uses: Roang-zero1/factorio-mod-luacheck@master + with: + luacheckrc_url: "" diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..ef437f1 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,12 @@ +unused_args = false +allow_defined_top = true +max_line_length = 999 + +globals = { + "minetest", "ts_workshop", +} + +read_globals = { + string = {fields = {"split", "trim"}}, + table = {fields = {"copy", "getn"}}, +} diff --git a/init.lua b/init.lua index 54f78fc..f77c40f 100755 --- a/init.lua +++ b/init.lua @@ -84,8 +84,8 @@ function ts_workshop.register_workshop(mod, name, def) local timer = minetest.get_node_timer(pos) timer:start(0.2) else - meta:set_int("progress", 0) progress = 0 + meta:set_int("progress", progress) local inv = meta:get_inventory() inv:add_item("output", working_on) meta:set_string("working_on", "")