From 05cb73fdcdaaa053daeadf9ed95f3895779b2d9b Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Wed, 18 Oct 2023 08:12:07 +0200 Subject: [PATCH] luacheck for map init code --- luacheck.sh | 2 +- mods/super_sam_map/.luacheckrc | 21 +++++++++++++++++++++ mods/super_sam_map/init.lua | 8 +++++--- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 mods/super_sam_map/.luacheckrc diff --git a/luacheck.sh b/luacheck.sh index 19bf392..0116ae8 100755 --- a/luacheck.sh +++ b/luacheck.sh @@ -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 \ No newline at end of file diff --git a/mods/super_sam_map/.luacheckrc b/mods/super_sam_map/.luacheckrc new file mode 100644 index 0000000..1809fbc --- /dev/null +++ b/mods/super_sam_map/.luacheckrc @@ -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" +} diff --git a/mods/super_sam_map/init.lua b/mods/super_sam_map/init.lua index 7bc4023..4d2de4a 100644 --- a/mods/super_sam_map/init.lua +++ b/mods/super_sam_map/init.lua @@ -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