Skip to content

Commit

Permalink
Add LuaCheck workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Mar 25, 2024
1 parent 67926f2 commit 0d80e60
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Check"
on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: apt
run: sudo apt-get update && sudo apt-get install -y luarocks
- name: luacheck install
run: luarocks install --local luacheck
- name: luacheck run
run: $HOME/.luarocks/bin/luacheck mods
19 changes: 19 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
unused_args = false
allow_defined_top = true

globals = {
"default"
}

read_globals = {
"minetest",
"dump",
"vector",
"VoxelManip", "VoxelArea",
"PseudoRandom", "PcgRandom",
"ItemStack",
"Settings",
}

-- Overwrites fields in minetest
files["mods/default/init.lua"].globals = { "minetest" }

0 comments on commit 0d80e60

Please sign in to comment.