-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphpcs.xml.dist
55 lines (44 loc) · 1.85 KB
/
phpcs.xml.dist
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
<?xml version="1.0"?>
<ruleset name="WordPress Feature API">
<description>WordPress Feature API PHP_CodeSniffer ruleset.</description>
<!-- Exclude paths -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/tests/bootstrap.php</exclude-pattern>
<exclude-pattern>/demo/*</exclude-pattern>
<!-- Include the WordPress standard -->
<rule ref="WordPress">
<!-- Add any rules you want to exclude here -->
<!-- <exclude name="WordPress.Files.FileName.InvalidClassFileName" /> -->
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped" />
</rule>
<!-- Include WordPress-Extra for additional best practices -->
<rule ref="WordPress-Extra" />
<!-- Let's also check that everything is properly documented -->
<rule ref="WordPress-Docs" />
<!-- Add in some extra rules from other standards -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter" />
<rule ref="Generic.Commenting.Todo" />
<!-- Check for PHP cross-version compatibility -->
<config name="testVersion" value="7.0-" />
<rule ref="PHPCompatibilityWP" />
<!-- Set tab width -->
<arg name="tab-width" value="4" />
<!-- Show progress, show sniff codes in all reports, and use colors -->
<arg value="ps" />
<arg name="colors" />
<!-- Scan all files in directory -->
<file>.</file>
<!-- Specifying extensions to check -->
<arg name="extensions" value="php" />
<!-- WordPress specific configuration -->
<config name="minimum_supported_wp_version" value="5.9" />
<!-- Rules for WordPress Functions -->
<rule ref="WordPress.WP.DeprecatedFunctions">
<properties>
<property name="minimum_wp_version" value="5.9" />
</properties>
</rule>
</ruleset>