-
Notifications
You must be signed in to change notification settings - Fork 9
/
phpcs.xml
109 lines (94 loc) · 3.08 KB
/
phpcs.xml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0" ?>
<ruleset name="WordPress Theme Boilerplate" namespace="WordPress\Theme\Boilerplate">
<!--
Provide installation path to the WordPress Coding Standards
-->
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs" />
<!--
Check only files with .php extension
-->
<arg name="extensions" value="php" />
<arg value="-colors" />
<arg value="ns" />
<!--
Exclude from checking package managers directiories
-->
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>node_modules/*</exclude-pattern>
<!--
Disallow using a short array syntax
-->
<rule ref="Generic.Arrays.DisallowShortArraySyntax.Found">
<type>warning</type>
</rule>
<!--
Extend WordPress Coding Standard ruleset
-->
<rule ref="WordPress-Extra">
<!--
Disabled intentionally
-->
<exclude name="WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter" />
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine" />
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound" />
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceAfterArrayOpener" />
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceBeforeArrayCloser" />
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound" />
<!--
Should be warnings
-->
<exclude name="WordPress.WP.EnqueuedResourceParameters.NoExplicitVersion" />
<exclude name="WordPress.WP.EnqueuedResources.NonEnqueuedScript" />
<!--
Rules that are buggy
-->
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent" />
<exclude name="WordPress.Arrays.ArrayIndentation" />
</rule>
<!--
Check for valid text-domains provided in the $text_domain property
@todo Update a rule value to your project textdomain string
-->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="theme_domain" />
</properties>
</rule>
<!--
Check for valid prefixes in functions names
@todo Update a rule value to your project textdomain string
-->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="themeprefix" />
</properties>
</rule>
<!--
Turn on theme's filenames validation
-->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="is_theme" value="true" />
</properties>
</rule>
<!--
Check for usage of deprecated functions
-->
<rule ref="WordPress.WP.DeprecatedFunctions">
<properties>
<property name="minimum_supported_version" value="4.9" />
</properties>
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2" />
<property name="tabIndent" value="false" />
</properties>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="indent" value="2" />
</properties>
</rule>
</ruleset>