-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelta.xml
203 lines (167 loc) · 7.5 KB
/
delta.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<?xml version="1.0"?>
<ruleset name="DELTA-Custom-Development-WP">
<description>A custom set of rules based on WordPress project</description>
<!-- Only scan PHP files. -->
<arg name="extensions" value="php"/>
<!-- Check up to 8 files simultanously. -->
<arg name="parallel" value="8"/>
<!-- Load additional standards. -->
<config name="installed_paths" value="/misc/temp/phpcs/WordPress-Coding-Standards,/misc/temp/phpcs/PHPCompatibility,/misc/temp/phpcs/PHPCSUtils,/misc/temp/phpcs/PHPCSExtra" />
<!-- Exclude the Composer Vendor directory. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- Exclude the Node Modules directory. -->
<exclude-pattern>/node_modules/*</exclude-pattern>
<!-- Exclude minified Javascript files. -->
<exclude-pattern>*.min.js</exclude-pattern>
<!-- Include the PSR1 standard. -->
<rule ref="PSR1">
<!-- WordPress has its own rules for these. -->
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
<exclude name="PSR1.Classes.ClassDeclaration"/>
<exclude name="PSR1.Methods.CamelCapsMethodName"/>
<!-- Legacy code has lots of side effects. -->
<exclude name="PSR1.Files.SideEffects"/>
</rule>
<!-- Include the PSR12 standard. -->
<rule ref="PSR12">
<!-- WordPress has its own rules for these. -->
<exclude name="Generic.Files.LineLength"/>
<exclude name="PSR12.ControlStructures.ControlStructureSpacing"/>
<exclude name="PSR12.Files.FileHeader"/>
<exclude name="PSR2.Classes.ClassDeclaration"/>
<exclude name="PSR2.Methods.FunctionCallSignature"/>
<exclude name="Squiz.Classes.ValidClassName"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration"/>
</rule>
<!-- Include the WordPress standard. -->
<rule ref="WordPress">
<!--
We can run `phpcs` with the '-s' flag, which allows us to see the names
of the sniffs reporting errors. Once we know the sniff names, we can opt
to exclude sniffs which don't suit our project.
-->
<!-- Allow short echo tags, i.e. <?= ?> -->
<exclude name="Generic.PHP.DisallowShortOpenTag"/>
<!-- Not using PEAR_Class_Names. -->
<exclude name="PEAR.NamingConventions.ValidClassName"/>
<!-- File-level comments are not required. -->
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/>
<!-- Comment alignment spacing. -->
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamType"/>
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamName"/>
<!-- Add back? Double quotes only when necessary. -->
<exclude name="Squiz.Strings.DoubleQuoteUsage"/>
<!-- Allow increment/decrement after variable. -->
<exclude name="Universal.Operators.DisallowStandalonePostIncrementDecrement"/>
<!-- Add back? Hyphenated filenames. -->
<exclude name="WordPress.Files.FileName"/>
<!-- Add back? No assignments in while conditions. -->
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/>
<!-- Add back? date() vs gmdate(). -->
<exclude name="WordPress.DateTime"/>
<!-- No WordPress spaces. -->
<exclude name="Generic.WhiteSpace.ArbitraryParenthesesSpacing"/>
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing"/>
<exclude name="WordPress.Arrays.ArrayKeySpacingRestrictions"/>
<exclude name="WordPress.WhiteSpace"/>
<!-- Yoda is illogical and handled by WordPress.CodeAnalysis.AssignmentInCondition. -->
<exclude name="WordPress.PHP.YodaConditions"/>
<!-- WP Specific: Requires use of $wpdb. -->
<exclude name="WordPress.DB"/>
<!-- WP Specific: Requires use of WP functions. -->
<exclude name="WordPress.PHP.IniSet"/>
<exclude name="WordPress.Security"/>
<!-- WP Specific: General WordPress -->
<exclude name="WordPress.WP"/>
</rule>
<!-- Check for PHP cross-version compatibility. -->
<config name="testVersion" value="7.2-99.0"/>
<rule ref="PHPCompatibility">
<!-- PHP 4.3 - Incorrect error. -->
<exclude name="PHPCompatibility.PHP.NewFunctionParameters.php_uname_modeFound"/>
<!-- PHP 8.1 - We don't care that the default flags for htmlspecialchars() has changed. Both defaults are acceptable. -->
<exclude name="PHPCompatibility.ParameterValues.NewHTMLEntitiesFlagsDefault.NotSet"/>
</rule>
<!-- No spaces around function call signature. No WordPress spaces. -->
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="requiredSpacesAfterOpen" value="0"/>
<property name="requiredSpacesBeforeClose" value="0"/>
</properties>
</rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
<property name="requiredSpacesAfterOpen" value="0"/>
<property name="requiredSpacesBeforeClose" value="0"/>
</properties>
</rule>
<!-- Code quality. -->
<rule ref="Generic.CodeAnalysis">
<!-- Add back? No assignments in while conditions. -->
<exclude name="Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/>
<!-- Handled in a better way by Squiz.Commenting.EmptyCatchComment.Missing -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
</rule>
<rule ref="Generic.Commenting"/>
<rule ref="Generic.Metrics"/>
<rule ref="Generic.PHP.Syntax"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat">
<properties>
<property name="allowMultiline" value="true" />
</properties>
</rule>
<rule ref="Squiz.PHP.CommentedOutCode"/>
<rule ref="Squiz.PHP.DisallowMultipleAssignments"/>
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
<rule ref="Squiz.PHP.DiscouragedFunctions"/>
<rule ref="Squiz.PHP.EmbeddedPhp"/>
<rule ref="Squiz.PHP.Eval"/>
<rule ref="Squiz.PHP.InnerFunctions"/>
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<!-- Code commenting. -->
<rule ref="Squiz.Commenting.ClassComment"/>
<rule ref="Squiz.Commenting.FunctionComment">
<!-- Comment alignment spacing. -->
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamType"/>
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamName"/>
</rule>
<rule ref="Squiz.Commenting.InlineComment">
<!-- Add back? Requires either a period, question mark or exclamation point, but that's too restrictive (e.g. URLs). -->
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
</rule>
<rule ref="Squiz.Commenting.VariableComment"/>
<!-- Override statement alignment to have a single space. -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="1" />
</properties>
</rule>
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<property name="maxColumn" value="1"/>
</properties>
</rule>
<!-- Switch breaks are followed by newline or the switch end. -->
<rule ref="Squiz.ControlStructures.SwitchDeclaration">
<exclude name="Squiz.ControlStructures.SwitchDeclaration.BreakIndent" />
</rule>
<!-- Scope closing brace on own line. -->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace" />
<!-- Enforce arrays with commas and appropriate spaces. -->
<rule ref="NormalizedArrays.Arrays.ArrayBraceSpacing">
<properties>
<property name="spacesSingleLine" value="0"/>
</properties>
</rule>
<rule ref="NormalizedArrays.Arrays.CommaAfterLast"/>
<!-- Disallow PHP's alternative control structure syntax. -->
<rule ref="Universal.ControlStructures.DisallowAlternativeSyntax"/>
<!-- Forbidden functions. -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array" value="sizeof=>count,delete=>unset,print=>echo,create_function=>null,array_push=>null,array_key_exists=>isset" />
</properties>
</rule>
</ruleset>