|
| 1 | +<?xml version="1.0"?> |
| 2 | +<ruleset name="Developer Showcase"> |
| 3 | + <description>PSR-12 naming/structure with WordPress whitespace conventions.</description> |
| 4 | + |
| 5 | + <!-- Scan paths --> |
| 6 | + <file>./plugins</file> |
| 7 | + <file>./themes</file> |
| 8 | + |
| 9 | + <!-- Excluded directories --> |
| 10 | + <exclude-pattern>*/vendor/*</exclude-pattern> |
| 11 | + <exclude-pattern>*/node_modules/*</exclude-pattern> |
| 12 | + <exclude-pattern>*/build/*</exclude-pattern> |
| 13 | + |
| 14 | + <!-- Only check PHP files --> |
| 15 | + <arg name="extensions" value="php"/> |
| 16 | + <arg name="colors"/> |
| 17 | + <arg value="s"/> |
| 18 | + |
| 19 | + <!-- |
| 20 | + Base: PSR-12 |
| 21 | + Override indentation and control-structure spacing below. |
| 22 | + --> |
| 23 | + <rule ref="PSR12"> |
| 24 | + <!-- Exclude space-indentation — we use tabs --> |
| 25 | + <exclude name="Generic.WhiteSpace.DisallowTabIndent"/> |
| 26 | + <!-- Exclude PSR-12 control structure spacing — replaced by WP rule below --> |
| 27 | + <exclude name="PSR12.ControlStructures.ControlStructureSpacing"/> |
| 28 | + </rule> |
| 29 | + |
| 30 | + <!-- Enforce tab indentation --> |
| 31 | + <rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/> |
| 32 | + |
| 33 | + <!-- |
| 34 | + WordPress whitespace rules: |
| 35 | + Spaces inside parentheses for control structures: if ( $foo ) |
| 36 | + --> |
| 37 | + <rule ref="WordPress.WhiteSpace.ControlStructureSpacing"/> |
| 38 | + <rule ref="WordPress.WhiteSpace.CastStructureSpacing"/> |
| 39 | + <rule ref="WordPress.WhiteSpace.OperatorSpacing"/> |
| 40 | + <rule ref="WordPress.Arrays.ArrayDeclarationSpacing"/> |
| 41 | + |
| 42 | + <!-- WordPress security and best-practice sniffs --> |
| 43 | + <rule ref="WordPress.Security"/> |
| 44 | + <rule ref="WordPress.DB.PreparedSQL"/> |
| 45 | + <rule ref="WordPress.WP.EnqueuedResources"/> |
| 46 | + <rule ref="WordPress.PHP.NoSilencedErrors"/> |
| 47 | + <rule ref="WordPress.WP.DeprecatedFunctions"/> |
| 48 | + |
| 49 | + <!-- Disable Yoda conditions (team agreement) --> |
| 50 | + <rule ref="WordPress.PHP.YodaConditions"> |
| 51 | + <severity>0</severity> |
| 52 | + </rule> |
| 53 | + |
| 54 | + <!-- PHP Compatibility --> |
| 55 | + <rule ref="PHPCompatibilityWP"/> |
| 56 | + <config name="testVersion" value="8.1-"/> |
| 57 | + |
| 58 | + <!-- Pattern folder exclusions --> |
| 59 | + <rule ref="WordPress.WP.GlobalVariablesOverride"> |
| 60 | + <exclude-pattern>*/patterns/*</exclude-pattern> |
| 61 | + </rule> |
| 62 | + <rule ref="Generic.WhiteSpace.ScopeIndent.Incorrect"> |
| 63 | + <exclude-pattern>*/patterns/*</exclude-pattern> |
| 64 | + </rule> |
| 65 | +</ruleset> |
0 commit comments