-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathphpcs-sample.xml
47 lines (37 loc) · 1.99 KB
/
phpcs-sample.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
<?xml version="1.0"?>
<ruleset name="Sample - Rules">
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<description>Sample ruleset for your project.</description>
<!-- Include when not specified -->
<file>./wp-content/plugins</file>
<file>./wp-content/themes</file>
<!-- Sniff both PHP and JS. -->
<arg name="extensions" value="php/PHP,js/JS,jsx/JS,ts/JS,tsx/JS" />
<!-- Exclude paths -->
<exclude-pattern>*/dev/*</exclude-pattern>
<exclude-pattern>*/dist/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/local-config\.php</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<config name="minimum_supported_wp_version" value="5.9" />
<!-- @see https://github.com/PHPCompatibility/PHPCompatibility#using-a-custom-ruleset -->
<config name="testVersion" value="8.0" />
<!-- @see https://github.com/PHPCompatibility/PHPCompatibilityWP#how-to-use -->
<rule ref="PHPCompatibilityWP" />
<rule ref="WordPress">
<exclude-pattern>*/js/*</exclude-pattern>
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.Indent" />
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
<exclude name="PEAR.Functions.FunctionCallSignature.OpeningIndent" />
</rule>
<!-- Test against JS XXS https://vip.wordpress.com/documentation/vip-go/vip-code-review/javascript-security-best-practices/ -->
<rule ref="Lipe.JS">
<type>error</type>
</rule>
</ruleset>