-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.phpcs.xml.dist
80 lines (68 loc) · 3.31 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
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for plugin">
<description>Apply WordPress Coding Standards</description>
<!-- Prevent errors caused by WordPress Coding Standards not supporting PHP 8.0+. See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035 -->
<ini name="error_reporting" value="E_ALL & ~E_DEPRECATED" />
<!-- What to scan -->
<file>.</file>
<!-- Exclude files and folders -->
<exclude-pattern>*/build/*</exclude-pattern>
<exclude-pattern>*/deploy/*</exclude-pattern>
<exclude-pattern>*/languages/*</exclude-pattern>
<exclude-pattern>*/lib/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*\.(css|js)</exclude-pattern>
<exclude-pattern>src/Helper/GoogleFonts.php</exclude-pattern>
<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->
<!-- Minimum support WP Version. -->
<config name="minimum_wp_version" value="6.0"/>
<!-- Don't worry about files that don't contain any code -->
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
<!-- For CI, don't fail on warnings -->
<config name="ignore_warnings_on_exit" value="1"/>
<rule ref="WordPress" />
<rule ref="WordPress-Extra">
<!-- Forget about file names -->
<exclude name="WordPress.Files.FileName"/>
</rule>
<!-- Disallows grouped use declarations. -->
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse" />
<!-- Disallows leading backslash in use statement. -->
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" />
<!-- Checks whether uses at the top of a file are alphabetically sorted. -->
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" />
<!-- Prohibits uses from the same namespace. -->
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace" />
<!-- Looks for unused imports from other namespaces. -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true" />
</properties>
</rule>
<!-- All references to functions, classes and constants should import using a use statement. -->
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="allowFullyQualifiedGlobalFunctions" value="true" />
<property name="allowFullyQualifiedGlobalClasses" value="true" />
<property name="allowFullyQualifiedGlobalConstants" value="true" />
<property name="allowFallbackGlobalFunctions" value="true" />
<property name="allowFallbackGlobalConstants" value="true" />
<property name="allowFullyQualifiedNameForCollidingClasses" value="true" />
</properties>
</rule>
<!-- Loads the PHP Compatibility ruleset. -->
<rule ref="PHPCompatibilityWP" />
<!-- PHP version check. -->
<config name="testVersion" value="7.2-"/>
</ruleset>