diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a362033 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +charset = utf-8 +indent_size = 4 +indent_style = tab +trim_trailing_whitespace = true + +[{locale/template,locale/*.tr}] +end_of_line = lf \ No newline at end of file diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml new file mode 100644 index 0000000..ad07e4e --- /dev/null +++ b/.github/workflows/luacheck.yml @@ -0,0 +1,20 @@ +name: Luacheck +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Install Luarocks + run: | + sudo apt-get update -qyy + sudo apt-get install luarocks -qyy + + - name: Install Luacheck + run: luarocks install --local luacheck + + - name: Run Luacheck + run: $HOME/.luarocks/bin/luacheck ./ \ No newline at end of file diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..3a04d31 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,27 @@ +unused_args = false + +globals = { + "basic_machines" +} + +read_globals = { + "ItemStack", + "default", + "farming", + "machines", + "minetest", + "player_monoids", + "unified_inventory", + "vector", + table = {fields = {"copy"}} +} + +files["ball.lua"] = {globals = {"boneworld.killxp"}} +files["grinder.lua"] = {read_globals = {"i3"}} +files["keypad.lua"] = {read_globals = {"signs_lib"}} +files["machines_configuration.lua"] = {max_line_length = 190} +files["mark.lua"] = {globals = {"machines"}} +files["mesecon_adapter.lua"] = {read_globals = {"mesecon"}} +files["mover.lua"] = {max_line_length = 290, read_globals = {"bucket", "nodeupdate"}} +files["protect.lua"] = {globals = {"minetest.is_protected"}} +files["technic_power.lua"] = {max_line_length = 140} \ No newline at end of file