-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmago.toml
More file actions
executable file
·171 lines (147 loc) · 4.56 KB
/
mago.toml
File metadata and controls
executable file
·171 lines (147 loc) · 4.56 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Mago Configuration for Meilisearch WordPress Plugin
# Documentation: https://mago.carthage.software/guide/configuration
# Last updated: 2025-10-03
# ==============================================================================
# Global Options
# ==============================================================================
php-version = "8.1"
threads = 4
use-pager = false
# ==============================================================================
# Source Configuration
# ==============================================================================
[source]
# Directories to scan for PHP files
paths = ["includes", "admin", "public", "tests"]
# Include vendor for context (won't be analyzed/formatted)
includes = ["vendor"]
# Exclude specific paths and patterns
excludes = [
"vendor/**",
".phpdoc/**",
"tools/**",
"bin/**",
"docs/**",
"**/*_generated.php",
"**/node_modules/**"
]
# File extensions to consider as PHP
extensions = ["php"]
# ==============================================================================
# Formatter Configuration
# ==============================================================================
[formatter]
# Exclude specific paths from formatting
excludes = [
"vendor/**",
".phpdoc/**",
"tools/**"
]
# Line and indentation settings
print-width = 120
tab-width = 4
use-tabs = true
end-of-line = "lf"
# Code style preferences
single-quote = true
trailing-comma = true
remove-trailing-close-tag = true
# Brace styles (WordPress/PSR-12 compatible)
control-brace-style = "same_line"
closure-brace-style = "same_line"
function-brace-style = "next_line"
method-brace-style = "next_line"
classlike-brace-style = "next_line"
# Empty brace handling
inline-empty-control-braces = false
inline-empty-closure-braces = true
inline-empty-function-braces = false
inline-empty-method-braces = false
inline-empty-constructor-braces = true
inline-empty-classlike-braces = false
inline-empty-anonymous-class-braces = true
# Breaking and alignment
method-chain-breaking-style = "next_line"
array-table-style-alignment = true
# Import (use) statement handling
sort-uses = true
separate-use-types = true
expand-use-groups = true
# Type hints and syntax preferences
null-type-hint = "null_pipe"
# Empty line preferences
empty-line-after-opening-tag = true
empty-line-after-namespace = true
empty-line-after-use = true
empty-line-after-method = true
separate-class-like-members = true
# ==============================================================================
# Linter Configuration
# ==============================================================================
[linter]
# Framework integrations
integrations = ["wordpress", "phpunit"]
# Exclude paths from linting
excludes = [
"vendor/**",
".phpdoc/**",
"tools/**",
"tests/bootstrap.php"
]
# Baseline file for existing issues
baseline = "linter-baseline.toml"
# Rule configuration
[linter.rules]
# Disable rules that conflict with WordPress coding standards
ambiguous-function-call = { enabled = false }
literal-named-argument = { enabled = false }
# Complexity thresholds
cyclomatic-complexity = { level = "warning", threshold = 15 }
halstead = { effort-threshold = 7000 }
# Best practices
no-else-clause = { level = "help" }
no-empty = { level = "error" }
no-debug-symbols = { level = "error" }
no-eval = { level = "error" }
no-goto = { level = "error" }
# ==============================================================================
# Analyzer Configuration
# ==============================================================================
[analyzer]
# General options
excludes = [
"vendor/**",
".phpdoc/**",
"tools/**",
"tests/**"
]
# Issue categories (all enabled by default)
mixed-issues = true
falsable-issues = true
nullable-issues = true
redundancy-issues = true
reference-issues = true
unreachable-issues = true
deprecation-issues = true
impossibility-issues = true
ambiguity-issues = true
existence-issues = true
template-issues = true
argument-issues = true
operand-issues = true
property-issues = true
generator-issues = true
array-issues = true
return-issues = true
method-issues = true
iterator-issues = true
# Feature flags
find-unused-expressions = false
find-unused-definitions = true
analyze-dead-code = false
memoize-properties = false
allow-possibly-undefined-array-keys = true
check-throws = true
perform-heuristic-checks = true
# Baseline file for existing issues
baseline = "analyzer-baseline.toml"