Skip to content

Commit 217a98a

Browse files
jrfnlgrogy
authored andcommitted
Ruleset: add a few selective exclusions
... for things to be addressed at a later point in time and a few which don't need addressing at all.
1 parent 7d7fe9d commit 217a98a

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

phpcs.xml.dist

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
<rule ref="PHPParallelLint">
4242
<!-- For improved readability, a blank line should be allowed before the next leaf in a if/else control structure. -->
4343
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
44+
45+
<!-- This package includes a polyfill for the JsonSerializable interface. -->
46+
<exclude name="PHPCompatibility.Interfaces.NewInterfaces.jsonserializableFound"/>
4447
</rule>
4548

4649
<rule ref="Generic.PHP.NoSilencedErrors">
@@ -54,4 +57,50 @@
5457
</properties>
5558
</rule>
5659

60+
61+
<!--
62+
#############################################################################
63+
SELECTIVE EXCLUSIONS
64+
Exclude specific files for specific sniffs and/or exclude sub-groups in sniffs.
65+
#############################################################################
66+
-->
67+
68+
<!-- Polyfill for PHP native interface, can't be in a namespace. -->
69+
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
70+
<exclude-pattern>src/polyfill\.php$</exclude-pattern>
71+
</rule>
72+
73+
74+
<!--
75+
#############################################################################
76+
TEMPORARY EXCLUSIONS
77+
These adjustments should be removed once the codebase has been fixed up.
78+
#############################################################################
79+
-->
80+
81+
<!-- To be addressed at a later point in time. -->
82+
<rule ref="Generic.Metrics.CyclomaticComplexity">
83+
<exclude-pattern>/src/(Application|ParallelLint|Settings|Outputs/TextOutput)\.php$</exclude-pattern>
84+
</rule>
85+
86+
<!-- To be addressed in test refactor. -->
87+
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
88+
<exclude-pattern>/tests/Output\.phpt$</exclude-pattern>
89+
</rule>
90+
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
91+
<exclude-pattern>/tests/*\.php[t]?$</exclude-pattern>
92+
</rule>
93+
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
94+
<exclude-pattern>/tests/*\.phpt$</exclude-pattern>
95+
</rule>
96+
<rule ref="PSR12.Files.FileHeader.SpacingAfterBlock">
97+
<exclude-pattern>/tests/skip-on-5.3/trait\.php$</exclude-pattern>
98+
</rule>
99+
<rule ref="PSR12.Files.OpenTag.NotAlone">
100+
<exclude-pattern>/tests/skip-on-5.3/trait\.php$</exclude-pattern>
101+
</rule>
102+
<rule ref="PHPCompatibility.Keywords.NewKeywords.t_traitFound">
103+
<exclude-pattern>/tests/skip-on-5.3/trait\.php$</exclude-pattern>
104+
</rule>
105+
57106
</ruleset>

0 commit comments

Comments
 (0)