-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
134 lines (117 loc) · 6.75 KB
/
Copy pathphpcs.xml
File metadata and controls
134 lines (117 loc) · 6.75 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
<?xml version="1.0"?>
<ruleset name="SprykerCommunitySearchDebug">
<description>
Coding standard for spryker-community/search-debug.
Mirrors the Spryker project standard, adjusted for a standalone package: it lints this
package's own paths and namespace rather than a shop's, so the same command runs in CI
without a host shop around it.
</description>
<config name="php_version" value="80300"/>
<file>src/</file>
<file>tests/</file>
<file>tools/</file>
<file>fixtures/</file>
<exclude-pattern>*/tests/*/_support/_generated/*</exclude-pattern>
<exclude-pattern>*/tests/*/_output/*</exclude-pattern>
<exclude-pattern>*/tests/*/_data/*</exclude-pattern>
<!-- Verbatim, checked-in Spryker CORE generated code (see the file's own docblock) — not this
package's own code, never meant to conform to its style. -->
<exclude-pattern>*/tests/_ci-standalone/Generated/*</exclude-pattern>
<!-- Freshly generated by tests/_ci-standalone/generate-transfers.php, gitignored, never committed —
same reason any real Spryker project excludes its own src/Generated/ from style checks. -->
<exclude-pattern>*/src/Generated/*</exclude-pattern>
<rule ref="vendor/spryker/code-sniffer/Spryker/ruleset.xml">
<exclude name="Spryker.Commenting.DocBlock"/>
<exclude name="Spryker.Commenting.DocBlockConst"/>
<exclude name="Spryker.Commenting.InlineDocBlock"/>
<exclude name="Spryker.Commenting.DocBlockApiAnnotation"/>
<exclude name="Spryker.Commenting.DocBlockReturnVoid"/>
<!--
Spryker's file-level doc block sniff rewrites the header to Spryker's own proprietary
copyright notice. This package is MIT licensed and every file carries the matching MIT
header, so this sniff must stay off — running it would silently replace the licence text.
-->
<exclude name="Spryker.Commenting.FileDocBlock"/>
</rule>
<rule ref="vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml"/>
<rule ref="Spryker.Internal.SprykerDisallowFunctions">
<properties>
<!-- Keep 8.3 compatibility: the package declares php >= 8.3. -->
<property name="phpVersion" value="8.3"/>
</properties>
</rule>
<rule ref="Spryker.Namespaces.SprykerNamespace">
<properties>
<property name="namespace" value="SprykerCommunity"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse"/>
<!--
Codeception's generated Actor/Tester classes always carry the bare `@SuppressWarnings(PHPMD)`
annotation — PHPMD's own suppression convention, where "PHPMD" is a literal token, not a class
reference. This sniff doesn't know that and wants it "fully qualified", which would rewrite it
into a nonexistent class path. Spryker's own core packages carry this exact same bare form in
every one of their generated Testers, unfixed — this is a sniff/annotation mismatch, not a real
violation.
-->
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation">
<exclude-pattern>*/tests/*/_support/*Tester.php</exclude-pattern>
</rule>
<!--
This sniff only recognizes a docblock as attached to a declaration (rather than a floating
inline comment) when the very next token is private/protected/public/readonly/const, or static
followed by one of those — it never checks for `final`. ExplanationParser.php's
`final public const SYNONYM_TERM_SEPARATOR` (the package's only `final` constant) falls through
that gap and gets misclassified; an inline @phpcsSuppress on the same misclassified docblock
doesn't help, since the misclassification itself is what defeats the suppression lookup.
-->
<rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration">
<exclude-pattern>*/src/SprykerCommunity/Client/SearchDebug/Explanation/ExplanationParser.php</exclude-pattern>
</rule>
<!--
Off deliberately, not as a workaround for a lint failure. Spryker's docblock convention
documents every parameter with @param even where the native type hint repeats it, and those
annotations carry the array shapes (array<int, float> and friends) and the parameter
descriptions that native type hints cannot express, so deleting them would lose real
information, not noise. slevomat's ParameterTypeHint reports each such annotation as a
"useless @param annotation", and its ReturnTypeHint counterpart does the same for @return,
which together land as thousands of errors against Spryker-style docblocks. The convention
wins; the sniffs are silenced.
Both the SlevomatCodingStandard.* and SprykerStrict.* prefixes are listed: SprykerStrict
subclasses these sniffs and excludes its own UselessAnnotation codes, but that exclusion no
longer takes effect against the current slevomat, so the errors surface under one prefix or
the other depending on which versions resolve.
-->
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation">
<severity>0</severity>
</rule>
<rule ref="SprykerStrict.TypeHints.ParameterTypeHint.UselessAnnotation">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation">
<severity>0</severity>
</rule>
<rule ref="SprykerStrict.TypeHints.ReturnTypeHint.UselessAnnotation">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowNullSafeObjectOperator">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit"/>
<rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking"/>
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
<rule ref="SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable"/>
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator"/>
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter"/>
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable"/>
</ruleset>