Skip to content

Commit

Permalink
Merge pull request #1262 from WordPress-Coding-Standards/feature/1157…
Browse files Browse the repository at this point in the history
…-change-severity-dont-exclude-rules

Rulesets: lower severity instead of excluding checks
  • Loading branch information
GaryJones authored Dec 27, 2017
2 parents 735b899 + 7e5401c commit 8053463
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
37 changes: 26 additions & 11 deletions WordPress-Core/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,16 @@

<!-- Covers rule: For switch structures case should indent one tab from the
switch statement and break one tab from the case statement. -->
<rule ref="PSR2.ControlStructures.SwitchDeclaration">
<!-- Prevent duplicate messages for the same issue. Covered by other sniffs. -->
<exclude name="PSR2.ControlStructures.SwitchDeclaration.NotLower"/>
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BreakNotNewLine"/>
<exclude name="PSR2.ControlStructures.SwitchDeclaration.BodyOnNextLine"/>
<rule ref="PSR2.ControlStructures.SwitchDeclaration"/>
<!-- Prevent duplicate messages for the same issue. Covered by other sniffs. -->
<rule ref="PSR2.ControlStructures.SwitchDeclaration.NotLower">
<severity>0</severity>
</rule>
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakNotNewLine">
<severity>0</severity>
</rule>
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BodyOnNextLine">
<severity>0</severity>
</rule>

<!-- Covers rule: ... while spaces can be used mid-line for alignment. -->
Expand Down Expand Up @@ -130,11 +135,18 @@
-->
<!-- Covers rule: When embedding multi-line PHP snippets within a HTML block, the
PHP open and close tags must be on a line by themselves. -->
<rule ref="Squiz.PHP.EmbeddedPhp">
<exclude name="Squiz.PHP.EmbeddedPhp.SpacingBefore"/>
<exclude name="Squiz.PHP.EmbeddedPhp.Indent"/>
<exclude name="Squiz.PHP.EmbeddedPhp.OpenTagIndent"/>
<exclude name="Squiz.PHP.EmbeddedPhp.SpacingAfter"/>
<rule ref="Squiz.PHP.EmbeddedPhp"/>
<rule ref="Squiz.PHP.EmbeddedPhp.SpacingBefore">
<severity>0</severity>
</rule>
<rule ref="Squiz.PHP.EmbeddedPhp.Indent">
<severity>0</severity>
</rule>
<rule ref="Squiz.PHP.EmbeddedPhp.OpenTagIndent">
<severity>0</severity>
</rule>
<rule ref="Squiz.PHP.EmbeddedPhp.SpacingAfter">
<severity>0</severity>
</rule>


Expand Down Expand Up @@ -194,8 +206,11 @@
<property name="requiredSpacesAfterOpen" value="1"/>
<property name="requiredSpacesBeforeClose" value="1"/>
</properties>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose"/>
</rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose">
<severity>0</severity>
</rule>


<!-- Covers rule: Call a function, like so: my_function( $param1, func_param( $param2 ) ); -->
<rule ref="PEAR.Functions.FunctionCallSignature">
Expand Down
9 changes: 6 additions & 3 deletions WordPress-Extra/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@

<!-- And yet more best practices.
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1143 -->
<rule ref="PEAR.Files.IncludingFile">
<exclude name="PEAR.Files.IncludingFile.UseInclude"/>
<exclude name="PEAR.Files.IncludingFile.UseIncludeOnce"/>
<rule ref="PEAR.Files.IncludingFile"/>
<rule ref="PEAR.Files.IncludingFile.UseInclude">
<severity>0</severity>
</rule>
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
<severity>0</severity>
</rule>
<rule ref="PEAR.Files.IncludingFile.BracketsNotRequired">
<type>warning</type>
Expand Down

0 comments on commit 8053463

Please sign in to comment.