-
Notifications
You must be signed in to change notification settings - Fork 0
/
.luacheckrc
107 lines (93 loc) · 3.18 KB
/
.luacheckrc
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---@diagnostic disable
-- Luacheck configuration for AnoNvim
-- Reference: https://luacheck.readthedocs.io/en/stable/config.html
-- Define Neovim standard
stds.nvim = {
-- Global variables
globals = {
-- AnoNvim globals
"avim", -- AnoNvim namespace
"USER", -- Current user
"C", -- Configuration
"Config", -- Configuration object
"MUtils", -- Utility functions
-- Path variables
"WORKSPACE_PATH", -- Current workspace
"USER_CONFIG_PATH", -- User config directory
-- Special globals
"TERMINAL", -- Terminal handling
-- Extended standard libraries
vim = {
fields = {
"g", -- Global variables
"b", -- Buffer variables
"w", -- Window variables
"t", -- Tabpage variables
"v", -- Global variables
"env", -- Environment variables
"opt", -- Options
"api", -- Neovim API
"fn", -- Vim functions
"cmd", -- Command execution
"loop", -- Event loop
"schedule", -- Schedule callback
}
},
os = {
fields = {
"capture", -- Command output capture
"execute", -- Command execution
}
},
},
-- Read-only globals
read_globals = {
-- Lua/LuaJIT
"jit", -- LuaJIT specific
"os", -- Operating system
-- Neovim
"vim", -- Neovim API
"avim", -- AnoNvim namespace
-- Utility functions
"join_paths", -- Path joining
"get_runtime_dir", -- Runtime directory
"get_config_dir", -- Config directory
"get_cache_dir", -- Cache directory
"get_avim_base_dir", -- Base directory
},
}
-- Lua version and standards
std = "lua51+nvim"
-- Performance settings
cache = true -- Enable caching
max_cyclomatic_complexity = 20 -- Maximum function complexity
-- Code style
max_line_length = false -- Disable line length warnings
max_code_line_length = 120 -- But set a soft limit
max_string_line_length = 120
max_comment_line_length = 120
-- Method handling
self = false -- Don't report unused self arguments
-- Specific ignores
ignore = {
"631", -- Line length limit
"212/_.*", -- Unused arguments starting with _
"213/_.*", -- Unused loop variables starting with _
"542", -- Empty if branch
"211/_.*", -- Unused variable starting with _
}
-- Files to exclude
exclude_files = {
"lua/avim/lazy/**", -- Plugin manager files
"tests/**", -- Test files
".luacheckrc", -- This config file
}
-- Custom file patterns
files = {
["lua/avim/plugins/*.lua"] = {
enable = {"631"}, -- Enable line length checks for plugins
},
["lua/avim/core/*.lua"] = {
max_cyclomatic_complexity = 25, -- Allow more complexity in core
},
}