Use phpcs.xml for all rules

This commit is contained in:
QWp6t
2015-12-28 15:28:21 -08:00
committed by Ben Word
parent c5f3724efd
commit 246955c59a
4 changed files with 45 additions and 48 deletions

View File

@@ -3,8 +3,9 @@
<description>Roots Coding Standards</description>
<!-- Scan these files -->
<file>functions.php</file>
<file>src</file>
<file>templates</file>
<file>functions.php</file>
<file>src</file>
<!-- Show colors in console -->
<arg value="-colors"/>
@@ -14,7 +15,47 @@
<!-- Use PSR-2 as a base -->
<rule ref="PSR2">
<!-- Allow braces on same line for procedural functions -->
<!-- Allow braces on same line for named functions -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
</rule>
<!-- Allow closing braces to be on the same line -->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace">
<exclude-pattern>templates</exclude-pattern>
</rule>
<!-- Disable newline after opening brace -->
<rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace">
<exclude-pattern>templates</exclude-pattern>
</rule>
<!-- Allow multiple PHP statements in the same line -->
<rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine">
<exclude-pattern>templates</exclude-pattern>
</rule>
<!-- Disable PSR-2 indentation rules that are buggy with 2 spaces -->
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent">
<exclude-pattern>templates</exclude-pattern>
</rule>
<!-- Don't require a blank line after the last `use` -->
<rule ref="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse">
<exclude-pattern>templates</exclude-pattern>
</rule>
<!-- Allow long lines -->
<rule ref="Generic.Files.LineLength.TooLong">
<exclude-pattern>templates</exclude-pattern>
</rule>
<!-- Ignore indentation rules -->
<rule ref="Generic.WhiteSpace.ScopeIndent">
<exclude-pattern>templates</exclude-pattern>
</rule>
<!-- Allow PHP closing tags -->
<rule ref="PSR2.Files.ClosingTag.NotAllowed">
<exclude-pattern>templates</exclude-pattern>
</rule>
</ruleset>