-
Notifications
You must be signed in to change notification settings - Fork 17
/
phpcs.xml
69 lines (61 loc) · 2.52 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
<?xml version="1.0"?>
<ruleset name="CrowdFavorite PSR12-based Coding Standards">
<description>Custom variant of PSR12 with WordPress security checks for PHP development</description>
<!-- Default ruleset is PSR12 with one exception - tabs instead of spaces is allowed and preferred -->
<rule ref="PSR12">
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<!-- WordPress security rules are included to check for sanitization of WordPress code -->
<rule ref="WordPress.DB.PreparedSQLPlaceholders"/>
<rule ref="WordPress.DB.RestrictedFunctions"/>
<rule ref="WordPress.DB.RestrictedClasses"/>
<rule ref="WordPress.Security.EscapeOutput"/>
<rule ref="WordPress.Security.NonceVerification"/>
<rule ref="WordPress.WP.EnqueuedResources"/>
<!-- Check for WordPress code deprecated since version 4.9 -->
<rule ref="WordPress.WP.DeprecatedFunctions">
<properties>
<property name="minimum_supported_version" value="4.9" />
</properties>
<rule ref="WordPress.WP.DeprecatedClasses"/>
<properties>
<property name="minimum_supported_version" value="4.9" />
</properties>
<rule ref="WordPress.WP.DeprecatedParameters"/>
<properties>
<property name="minimum_supported_version" value="4.9" />
</properties>
<rule ref="WordPress.WP.DeprecatedParameterValues"/>
<properties>
<property name="minimum_supported_version" value="4.9" />
</properties>
<rule ref="WordPress.WP.AlternativeFunctions"/>
<properties>
<property name="minimum_supported_version" value="4.9" />
</properties>
<rule ref="WordPress.WP.DiscouragedConstants"/>
<properties>
<property name="minimum_supported_version" value="4.9" />
</properties>
<rule ref="WordPress.WP.DiscouragedFunctions"/>
<properties>
<property name="minimum_supported_version" value="4.9" />
</properties>
</rule>
<!-- Exclude node and vendor directories -->
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/dependencies/*</exclude-pattern>
<exclude-pattern>*/lib/*</exclude-pattern>
<!-- Check the files in the project directory. Where this xml file should be located. -->
<file>.</file>
<!-- Exclude the project directory path from the report, making for cleaner output. -->
<arg name="basepath" value="."/>
<!-- Check only PHP files. -->
<arg name="extensions" value="php"/>
<!-- Display output in color on the command line. Show the sniffs. Show progress. -->
<arg name="colors" />
<arg value="s" />
<arg value="p" />
</ruleset>