summaryrefslogtreecommitdiff
path: root/.luacheckrc
blob: e010ab95c02452fa3b899acec52ef129920c0f94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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", "trim"}},
	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",
	},
}

files["builtin/common/tests"] = {
	read_globals = {
		"describe",
		"it",
		"assert",
	},
}