Skip to content

Commit b1eccf1

Browse files
committed
Rules config update.
1 parent 4175d2e commit b1eccf1

1 file changed

Lines changed: 16 additions & 29 deletions

File tree

PhpCollective/ruleset.xml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@
9292
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
9393

9494
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/>
95-
<!-- skip for now, not autofixable
96-
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable"/>
97-
-->
95+
<!-- Intentionally disabled: reports require manual review (removing a variable
96+
can drop a side-effecting call), so it's not a good fit for autofix-based flows. -->
97+
<!-- <rule ref="SlevomatCodingStandard.Variables.UnusedVariable"/> -->
9898

9999
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
100100
<rule ref="SlevomatCodingStandard.PHP.ShortList"/>
@@ -151,16 +151,19 @@
151151
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/>
152152
<rule ref="Squiz.ControlStructures.LowercaseDeclaration"/>
153153

154-
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
155-
<severity>0</severity>
156-
</rule>
157-
158-
<rule ref="PSR2"/>
159-
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
160-
<severity>0</severity>
161-
</rule>
162-
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed">
163-
<severity>0</severity>
154+
<rule ref="PSR2">
155+
<!-- Inherited via PSR-2. Long-standing exclusion; mixing declarations and side effects is tolerated. -->
156+
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
157+
<!-- We allow the `_privateMethod` convention. -->
158+
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
159+
<!-- Duplicate of PhpCollective.ControlStructures.ElseIfDeclaration.NotAllowed (our own sniff handles it). -->
160+
<exclude name="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed"/>
161+
<!-- LineLength soft-limit warning is enough; no hard error. -->
162+
<exclude name="Generic.Files.LineLength.TooLong"/>
163+
<!-- Contradictory to PSR-12 (PSR-12 overrules PSR-2) -->
164+
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/>
165+
<exclude name="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterFirst"/>
166+
<exclude name="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterSecond"/>
164167
</rule>
165168

166169
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
@@ -172,9 +175,6 @@
172175

173176
<rule ref="Zend.Files.ClosingTag"/>
174177
<rule ref="Generic.Files.LineEndings"/>
175-
<rule ref="Generic.Files.LineLength.TooLong">
176-
<severity>0</severity>
177-
</rule>
178178

179179
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
180180
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration"/>
@@ -188,8 +188,6 @@
188188
</properties>
189189
</rule>
190190

191-
<rule ref="PEAR.Functions.ValidDefaultValue"/>
192-
193191
<rule ref="PEAR.NamingConventions.ValidClassName"/>
194192

195193
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
@@ -225,17 +223,6 @@
225223
<exclude name="PSR12.Files.OpenTag"/>
226224
</rule>
227225

228-
<!-- Disabled - these are contradictory to PSR12 (and PSR12 overrules PSR2) -->
229-
<rule ref="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace">
230-
<severity>0</severity>
231-
</rule>
232-
<rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterSecond">
233-
<severity>0</severity>
234-
</rule>
235-
<rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterFirst">
236-
<severity>0</severity>
237-
</rule>
238-
239226
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing"/>
240227

241228
<rule ref="Squiz.Scope.MemberVarScope"/>

0 commit comments

Comments
 (0)