-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmago.toml
More file actions
65 lines (59 loc) · 2.84 KB
/
Copy pathmago.toml
File metadata and controls
65 lines (59 loc) · 2.84 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
# Mago configuration for MageForge
# https://mago.carthage.software/
php-version = "8.3"
[source]
paths = ["src"]
includes = ["vendor"]
extensions = ["php", "phtml"]
# .trunk contains symlinks into the developer's host cache (~/.cache/trunk)
# that are dangling inside the ddev container and would log walk warnings.
# The astock phpcs-psr2-stock dir ships legacy sniffs with real parse errors.
excludes = [
"**/.trunk/**",
"**/astock/stock-api-libphp/libs/phpcs-psr2-stock/**",
]
[parser]
enable-short-tags = false
[formatter]
inline-empty-constructor-braces = false
inline-empty-classlike-braces = false
[analyzer]
# Fail on every reported finding (notes, help, warnings, errors) — not just
# errors. Keeps `ddev mago analyze` and the CI job red until the report is
# completely clean instead of silently passing with warnings.
minimum-fail-level = "note"
# phtml templates rely on variables ($block, $escaper, $secureRenderer, …) that
# Magento's template engine injects into the render scope at runtime. A static
# analyzer cannot know them, so every template would report "undefined variable"
# plus a cascade of mixed-* follow-ups. Exclude templates from `mago analyze`
# only — `mago lint`/`mago fmt` still cover them (they don't type-check scope).
excludes = ["**/*.phtml"]
# Magento framework APIs (ObjectManager, InputInterface::getOption(), collection
# items, …) are pervasively typed as `mixed`, so `mixed-assignment`/`mixed-operand`
# fire throughout idiomatic Magento code without pointing at real bugs. PHPStan
# level 9 (with the Magento extension, see phpstan.neon) is the project's type
# gate for these; `mago analyze` gates on the higher-confidence type errors.
ignore = ["mixed-assignment", "mixed-operand"]
[linter.rules]
# Code-size metrics: Magento CLI commands and services are naturally verbose;
# refactoring purely to satisfy thresholds is not a goal of this codebase.
cyclomatic-complexity = { enabled = false }
kan-defect = { enabled = false }
halstead = { enabled = false }
too-many-methods = { enabled = false }
excessive-parameter-list = { enabled = false }
# Magento idioms: empty()/isset() and boolean flags are pervasive in framework
# APIs and interfaces we implement; PHPStan level 9 covers the real pitfalls.
no-empty = { enabled = false }
no-isset = { enabled = false }
no-boolean-flag-parameter = { enabled = false }
# Style preferences that conflict with the Magento2 coding standard or would
# cause churn without correctness value.
literal-named-argument = { enabled = false }
braced-string-interpolation = { enabled = false }
no-else-clause = { enabled = false }
prefer-early-continue = { enabled = false }
no-shorthand-ternary = { enabled = false }
# Conflicts with the inline `/** @var ... */` + return-variable pattern this
# codebase uses to type ObjectManager/framework returns for PHPStan level 9.
inline-variable-return = { enabled = false }