-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruleset.xml
153 lines (126 loc) · 4.62 KB
/
ruleset.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?xml version="1.0"?>
<ruleset name="EE WordPress Coding Standards">
<description>EE WordPress Coding Standards</description>
<config name="encoding" value="utf-8"/>
<!-- Exclude certain patterns -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>*/data/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
<exclude-pattern>*.css</exclude-pattern>
<!-- Only check php code -->
<arg name="extensions" value="php"/>
<!-- Enable colors in report -->
<arg name="colors"/>
<!-- Add source codes in the report -->
<arg value="s"/>
<!-- Tabs should represent 2 spaces. -->
<arg name="tab-width" value="2" />
<!-- Load WordPress Coding standards -->
<rule ref="WordPress-Extra"/>
<!-- Ignore space indent error -->
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent">
<severity>0</severity>
</rule>
<!-- Set the default indent value and force spaces instead of tabs -->
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent">
<properties>
<property name="indent" value="2"/>
<property name="tabIndent" value="false"/>
</properties>
</rule>
<!-- Ignore whitespace precision alignment -->
<rule ref="WordPress.WhiteSpace.PrecisionAlignment">
<severity>0</severity>
</rule>
<!-- Set the default indent value and force spaces instead of tabs -->
<rule ref="WordPress.WhiteSpace.PrecisionAlignment">
<properties>
<property name="indent" value="2"/>
<property name="tabIndent" value="false"/>
</properties>
</rule>
<!-- Ignore alignment with surrounding assignments -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="1" />
<property name="error" value="false" />
</properties>
</rule>
<!-- Add checking for unused function parameters -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<!-- Ignore rule about enqueueing scripts in the footer -->
<rule ref="WordPress.WP.EnqueuedResourceParameters.NotInFooter">
<severity>0</severity>
</rule>
<!-- Modify post per page limit -->
<rule ref="WordPress.WP.PostsPerPage">
<properties>
<property name="posts_per_page" value="1000"/>
</properties>
</rule>
<!-- Exclude the multiline array indentation sniff,
because it clashes with Generic indentation sniff -->
<rule ref="WordPress.Arrays.ArrayIndentation">
<severity>0</severity>
</rule>
<!-- Set the default indent value and force spaces instead of tabs -->
<rule ref="WordPress.Arrays.ArrayIndentation">
<properties>
<property name="tabIndent" value="false"/>
</properties>
</rule>
<!-- Exclude WordPress array indentation because it forced 4 space indentation -->
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<property name="alignMultilineItems" value="!=100"/>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2"/>
<property name="tabIndent" value="false"/>
</properties>
</rule>
<!-- Rule that will correctly indent arrays -->
<rule ref="Generic.Arrays.ArrayIndent">
<properties>
<property name="indent" value="2" />
</properties>
</rule>
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
<!-- Function parameters have to have a space before opening
and after closing braces. Also the default indentaion of properties is 2 spaces -->
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="indent" value="2"/>
<property name="requiredSpacesAfterOpen" value="1" />
<property name="requiredSpacesBeforeClose" value="1" />
</properties>
</rule>
<!-- Allow theme hierarchy specific file name exceptions -->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="is_theme" value="true" />
</properties>
</rule>
<!-- Forbidden space after function keyword and open parenthesis -->
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="spaces_before_closure_open_paren" value="0" />
</properties>
</rule>
<!-- Ignore unused parameters in functions on account on hooks -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.Found">
<severity>0</severity>
</rule>
<!-- Don't use Yoda conditions -->
<rule ref="WordPress.PHP.YodaConditions">
<severity>0</severity>
</rule>
<!-- Don't worry about files that don't contain any code -->
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
</ruleset>