-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.luacheckrc
More file actions
77 lines (66 loc) · 1.34 KB
/
.luacheckrc
File metadata and controls
77 lines (66 loc) · 1.34 KB
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
-- vim: ft=lua tw=80
-- Use Lua 5.1 + LuaJIT + Neovim globals
stds.nvim = {
read_globals = { "jit" }
}
std = "lua51+nvim"
-- Don't report unused self arguments of methods
self = false
-- Rerun tests only if their modification time changed
cache = true
-- Max line length
max_line_length = 120
max_code_line_length = 120
-- Max cyclomatic complexity
max_cyclomatic_complexity = 15
ignore = {
"631", -- max_line_length (handled separately)
"212/_.*", -- unused argument, for vars with "_" prefix
"214", -- used variable with unused hint ("_" prefix)
"121", -- setting read-only global variable 'vim'
"122", -- setting read-only field of global variable 'vim'
}
-- Global objects defined by Neovim
read_globals = {
"vim",
}
-- Mutable globals
globals = {
"vim.g",
"vim.b",
"vim.w",
"vim.o",
"vim.bo",
"vim.wo",
"vim.go",
"vim.env",
"_",
}
-- Files to exclude
exclude_files = {
".luarocks",
"lua_modules",
}
-- Test file specific settings
files["tests/**/*.lua"] = {
-- Allow test globals
read_globals = {
"describe",
"it",
"before_each",
"after_each",
"setup",
"teardown",
"pending",
"assert",
"spy",
"stub",
"mock",
},
}
-- Plugin file specific settings
files["plugin/**/*.lua"] = {
ignore = {
"122", -- Allow setting vim fields in plugin loader
},
}