-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpcs.xml
executable file
·93 lines (77 loc) · 3.34 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?xml version="1.0"?>
<ruleset name="Block Starter Kit WordPress Coding Standards">
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml -->
<!-- See https://github.com/10up/10up-code-review -->
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#properties-strongly-recommended-to-be-set -->
<description>Coding standards for Block Starter Kit using WP Enforcer.</description>
<!-- Explicitly point to where WPCS lives in the project -->
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs" />
<!-- Excludes: Generic -->
<exclude-pattern>*/bower-components/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*.json</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
<exclude-pattern>*.min.js</exclude-pattern>
<!-- Excludes: Kapow! specific -->
<exclude-pattern>assets/*</exclude-pattern>
<exclude-pattern>*.png</exclude-pattern>
<exclude-pattern>*.jpg</exclude-pattern>
<exclude-pattern>*.gif</exclude-pattern>
<!--
Don't get angry about checking files that don't contain code
@link https://github.com/stevegrunwell/wp-enforcer/issues/12
-->
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
<!-- Ignore mixed line-endings warnings -->
<rule ref="Internal.LineEndings.Mixed">
<severity>0</severity>
</rule>
<!-- Internal exceptions (often occur on minified files) -->
<rule ref="Internal.Tokenizer.Exception">
<severity>0</severity>
</rule>
<!-- Add in some extra rules from other standards. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
<!-- Include the WordPress Extra (Core + Extras) ruleset, with exclusions. -->
<rule ref="WordPress-Extra">
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
<exclude name="PEAR.Functions.FunctionCallSignature.Indent" />
</rule>
<!-- Include the WordPress Documentation ruleset -->
<rule ref="WordPress-Docs" />
<!-- VIP: Check that input is validated and sanitize -->
<rule ref="WordPress.Security.ValidatedSanitizedInput">
<properties>
<property name="check_validation_in_scope_only" value="true" />
</properties>
</rule>
<!-- VIP: Ensure that output is escaped -->
<rule ref="WordPress.Security.EscapeOutput"/>
<!-- VIP: Ensure that nonce verification is in place where relevant -->
<rule ref="WordPress.Security.NonceVerification"/>
<!-- Allow theme filename exceptions -->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="is_theme" value="true" />
</properties>
</rule>
<!-- Ensure that any i18n functions have a valid project-specific or Kapow textdomain -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="sw-snippet" />
</properties>
</rule>
<!-- Ensure that we're not using any functions deprecated three major versions ago -->
<rule ref="WordPress.WP.DeprecatedFunctions">
<properties>
<property name="minimum_supported_version" value="4.7" />
</properties>
</rule>
</ruleset>