-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathphpcs.xml.dist
67 lines (50 loc) · 2.34 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
65
66
67
<?xml version="1.0"?>
<ruleset name="WP PHPCS - Rules">
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<description>The custom ruleset for the WP PHPCS itself.</description>
<!-- Show file path based on project root. -->
<arg name="basepath" value="." />
<!-- Sniff both PHP and JS. -->
<arg name="extensions" value="php/PHP" />
<!-- Show sniff codes in all reports, and progress when running. -->
<arg value="sp" />
<!-- @see https://github.com/PHPCompatibility/PHPCompatibility#using-a-custom-ruleset -->
<config name="testVersion" value="7.4-" />
<!-- @see https://github.com/PHPCompatibility/PHPCompatibilityWP#how-to-use -->
<rule ref="PHPCompatibilityWP">
<exclude name="PHPCompatibility.Constants.NewConstants" />
</rule>
<!-- Include when not specified -->
<file>./src</file>
<exclude-pattern>dev/*</exclude-pattern>
<rule ref="Universal.Classes.DisallowFinalClass">
<type>error</type>
</rule>
<config name="minimum_wp_version" value="6.4" />
<rule ref="WordPress-Extra">
<exclude-pattern>*.js</exclude-pattern>
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="Generic.WhiteSpace.IncrementDecrementSpacing.SpaceAfterIncrement" />
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
<exclude name="WordPress.Files.FileName" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid" />
<exclude name="WordPress.NamingConventions.ValidVariableName" />
</rule>
<rule ref="WordPress-Docs">
<exclude-pattern>*.js</exclude-pattern>
</rule>
<!-- Enforce PSR1 compatible namespaces. -->
<rule ref="PSR1.Classes.ClassDeclaration" />
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<property name="alignMultilineItems" value="!=100" />
</properties>
</rule>
<rule ref="PSR2.Methods.FunctionClosingBrace" />
<!-- Disallow long array syntax. -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<!-- 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>