Repository navigation
Expand file tree
/
Copy pathphpcs.xml
More file actions
51 lines (42 loc) · 2.27 KB
/
Copy pathphpcs.xml
File metadata and controls
51 lines (42 loc) · 2.27 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
<?xml version="1.0"?>
<ruleset name="ON Toolkit Ruleset">
<description>WordPress Coding Standards for ON Toolkit</description>
<file>on-toolkit.php</file>
<file>src</file>
<file>bin</file>
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/>
<!-- Ignore vendor directory -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/assets/*</exclude-pattern>
<!-- Include WordPress Coding Standards -->
<rule ref="WordPress-Core">
<!-- PSR-4 namespaces mean we don't use class- prefix -->
<exclude name="WordPress.Files.FileName"/>
<!-- We prefer camelCase for object properties and methods in modern OOP -->
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
<exclude name="WordPress.NamingConventions.ValidFunctionName"/>
<!-- Modern PHP devs often prefer standard conditions over Yoda -->
<exclude name="WordPress.PHP.YodaConditions"/>
<!-- Allow string interpolation for table names like {$wpdb->prefix} -->
<exclude name="WordPress.DB.PreparedSQL.InterpolatedNotPrepared"/>
<!-- WPCS struggles with dynamic SQL builders and safely escaped values -->
<exclude name="WordPress.DB.PreparedSQL.NotPrepared"/>
<exclude name="WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare"/>
</rule>
<rule ref="WordPress-Docs">
<!-- We use PHPStan for strict typing, so we can relax aggressive docblock checks -->
<exclude name="Squiz.Commenting.FunctionComment.Missing"/>
<exclude name="Squiz.Commenting.ClassComment.Missing"/>
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/>
<exclude name="Squiz.Commenting.VariableComment.Missing"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
</rule>
</ruleset>