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