summaryrefslogtreecommitdiff
path: root/.luacheckrc
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-08-06 19:30:18 +0100
committerGitHub <noreply@github.com>2019-08-06 19:30:18 +0100
commit8e757859d6a6bf6482480904e8485e9344e567ab (patch)
tree3304aa9393a753b85143389c6f6ffec990cfa12e /.luacheckrc
parent8da35c22d1c8933090330b2f3c44b4cf2c6e6760 (diff)
downloadminetest-8e757859d6a6bf6482480904e8485e9344e567ab.tar.gz
minetest-8e757859d6a6bf6482480904e8485e9344e567ab.tar.bz2
minetest-8e757859d6a6bf6482480904e8485e9344e567ab.zip
Add luacheck to check builtin (#7895)
Diffstat (limited to '.luacheckrc')
-rw-r--r--.luacheckrc74
1 files changed, 74 insertions, 0 deletions
diff --git a/.luacheckrc b/.luacheckrc
new file mode 100644
index 000000000..a21051514
--- /dev/null
+++ b/.luacheckrc
@@ -0,0 +1,74 @@
+unused_args = false
+allow_defined_top = true
+
+ignore = {
+ "131", -- Unused global variable
+ "431", -- Shadowing an upvalue
+ "432", -- Shadowing an upvalue argument
+}
+
+read_globals = {
+ "ItemStack",
+ "INIT",
+ "DIR_DELIM",
+ "dump", "dump2",
+ "fgettext", "fgettext_ne",
+ "vector",
+ "VoxelArea",
+ "profiler",
+ "Settings",
+
+ string = {fields = {"split"}},
+ table = {fields = {"copy", "getn", "indexof", "insert_all"}},
+ math = {fields = {"hypot"}},
+}
+
+globals = {
+ "core",
+ "gamedata",
+ os = { fields = { "tempfolder" } },
+ "_",
+}
+
+files["builtin/client/register.lua"] = {
+ globals = {
+ debug = {fields={"getinfo"}},
+ }
+}
+
+files["builtin/common/misc_helpers.lua"] = {
+ globals = {
+ "dump", "dump2", "table", "math", "string",
+ "fgettext", "fgettext_ne", "basic_dump", "game", -- ???
+ "file_exists", "get_last_folder", "cleanup_path", -- ???
+ },
+}
+
+files["builtin/common/vector.lua"] = {
+ globals = { "vector" },
+}
+
+files["builtin/game/voxelarea.lua"] = {
+ globals = { "VoxelArea" },
+}
+
+files["builtin/game/init.lua"] = {
+ globals = { "profiler" },
+}
+
+files["builtin/common/filterlist.lua"] = {
+ globals = {
+ "filterlist",
+ "compare_worlds", "sort_worlds_alphabetic", "sort_mod_list", -- ???
+ },
+}
+
+files["builtin/mainmenu"] = {
+ globals = {
+ "gamedata",
+ },
+
+ read_globals = {
+ "PLATFORM",
+ },
+}