-
Notifications
You must be signed in to change notification settings - Fork 140
/
phpcs.xml.dist
64 lines (54 loc) · 2.53 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
56
57
58
59
60
61
62
63
64
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards">
<description>WooCommerce dev PHP_CodeSniffer ruleset.</description>
<!-- Set the minimum WP version -->
<config name="minimum_supported_wp_version" value="5.6"/>
<config name="testVersion" value="7.4-" />
<!-- Rules -->
<rule ref="WooCommerce-Core">
<!-- We use the PSR-4 naming convention rather than the WP one -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<!--All PHP files contain a single class with a comment so a file comment is redundant -->
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<!-- Rules related to comments. We will come back to implementing these rules-->
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="Squiz.Commenting.FunctionComment.Missing"/>
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/>
<exclude name="WooCommerce.Commenting.CommentHooks.MissingSinceComment"/>
<exclude name="WooCommerce.Commenting.CommentHooks.MissingHookComment"/>
<!-- Exceptions can be escaped before outputting not when thrown -->
<exclude name="WordPress.Security.EscapeOutput.ExceptionNotEscaped"/>
</rule>
<!-- Set the appropriate text domain. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="facebook-for-woocommerce"/>
</properties>
</rule>
<!-- Add manage_woocommerce to accepted user capabilities -->
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="custom_capabilities" type="array">
<element value="manage_woocommerce"/>
</property>
</properties>
</rule>
<!-- Check the main PHP file and everything in /includes -->
<arg name="extensions" value="php"/>
<file>.</file>
<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/assets/*</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>
<exclude-pattern>/bin/*</exclude-pattern>
<exclude-pattern>/data/*</exclude-pattern>
<exclude-pattern>/build/*</exclude-pattern>
<exclude-pattern>/includes/Products/GoogleProductTaxonomy.php</exclude-pattern>
</ruleset>