Skip to content

Commit

Permalink
luacheck for map init code
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Oct 18, 2023
1 parent 23173bf commit 05cb73f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion luacheck.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -e

for modname in super_sam super_sam_ambience super_sam_highscore super_sam_nodes super_sam_game_elements super_sam_hud super_sam_level
for modname in super_sam super_sam_ambience super_sam_highscore super_sam_nodes super_sam_game_elements super_sam_hud super_sam_level super_sam_map
do
sh -c "cd mods/${modname} && luacheck ."
done
21 changes: 21 additions & 0 deletions mods/super_sam_map/.luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
exclude_files = {
"data/*"
}

globals = {
"travelnet"
}

read_globals = {
-- Stdlib
string = {fields = {"split", "trim"}},
table = {fields = {"copy", "getn"}},

-- Minetest
"minetest", "vector", "ItemStack",
"dump", "dump2",
"VoxelArea", "AreaStore",

-- mods
"mapsync"
}
8 changes: 5 additions & 3 deletions mods/super_sam_map/init.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
local MP = minetest.get_modpath("super_sam_map")

mapsync.register_backend("default", {
type = "fs",
path = minetest.get_modpath("super_sam_map") .. "/map",
patch_path = minetest.get_modpath("super_sam_map") .. "/patch"
path = MP .. "/map",
patch_path = MP .. "/patch"
})

mapsync.register_data_backend({
type = "fs",
path = minetest.get_modpath("super_sam_map") .. "/data"
path = MP .. "/data"
})

-- only builders can use travelnets
Expand Down

0 comments on commit 05cb73f

Please sign in to comment.