|
3 | 3 | <description>Roots Coding Standards</description>
|
4 | 4 |
|
5 | 5 | <!-- Scan these files -->
|
6 |
| - <file>functions.php</file> |
7 |
| - <file>src</file> |
| 6 | + <file>templates</file> |
| 7 | + <file>functions.php</file> |
| 8 | + <file>src</file> |
8 | 9 |
|
9 | 10 | <!-- Show colors in console -->
|
10 | 11 | <arg value="-colors"/>
|
|
14 | 15 |
|
15 | 16 | <!-- Use PSR-2 as a base -->
|
16 | 17 | <rule ref="PSR2">
|
17 |
| - <!-- Allow braces on same line for procedural functions --> |
| 18 | + <!-- Allow braces on same line for named functions --> |
18 | 19 | <exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
|
19 | 20 | </rule>
|
| 21 | + |
| 22 | + <!-- Allow closing braces to be on the same line --> |
| 23 | + <rule ref="Squiz.WhiteSpace.ScopeClosingBrace"> |
| 24 | + <exclude-pattern>templates</exclude-pattern> |
| 25 | + </rule> |
| 26 | + |
| 27 | + <!-- Disable newline after opening brace --> |
| 28 | + <rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"> |
| 29 | + <exclude-pattern>templates</exclude-pattern> |
| 30 | + </rule> |
| 31 | + |
| 32 | + <!-- Allow multiple PHP statements in the same line --> |
| 33 | + <rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine"> |
| 34 | + <exclude-pattern>templates</exclude-pattern> |
| 35 | + </rule> |
| 36 | + |
| 37 | + <!-- Disable PSR-2 indentation rules that are buggy with 2 spaces --> |
| 38 | + <rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent"> |
| 39 | + <exclude-pattern>templates</exclude-pattern> |
| 40 | + </rule> |
| 41 | + |
| 42 | + <!-- Don't require a blank line after the last `use` --> |
| 43 | + <rule ref="PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse"> |
| 44 | + <exclude-pattern>templates</exclude-pattern> |
| 45 | + </rule> |
| 46 | + |
| 47 | + <!-- Allow long lines --> |
| 48 | + <rule ref="Generic.Files.LineLength.TooLong"> |
| 49 | + <exclude-pattern>templates</exclude-pattern> |
| 50 | + </rule> |
| 51 | + |
| 52 | + <!-- Ignore indentation rules --> |
| 53 | + <rule ref="Generic.WhiteSpace.ScopeIndent"> |
| 54 | + <exclude-pattern>templates</exclude-pattern> |
| 55 | + </rule> |
| 56 | + |
| 57 | + <!-- Allow PHP closing tags --> |
| 58 | + <rule ref="PSR2.Files.ClosingTag.NotAllowed"> |
| 59 | + <exclude-pattern>templates</exclude-pattern> |
| 60 | + </rule> |
20 | 61 | </ruleset>
|
0 commit comments