-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathphpcs.xml
More file actions
73 lines (61 loc) · 2.15 KB
/
phpcs.xml
File metadata and controls
73 lines (61 loc) · 2.15 KB
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
<?xml version="1.0"?>
<ruleset name="CS">
<description>Custom coding standards.</description>
<config name="testVersion" value="5.6-"/>
<!-- Scan all files in directory -->
<file>./tests</file>
<file>./web/app</file>
<!-- Ignore WordPress and Composer dependencies -->
<exclude-pattern>tests/_output</exclude-pattern>
<exclude-pattern>web/wp</exclude-pattern>
<exclude-pattern>\.codeception/*</exclude-pattern>
<exclude-pattern>\.github/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>node_modues/*</exclude-pattern>
<exclude-pattern>assets/*</exclude-pattern>
<!-- Scan only PHP files -->
<arg name="extensions" value="php"/>
<arg name="colors"/>
<arg name="parallel" value="100"/>
<arg name="cache" value=".phpcs.cache"/>
<!-- Show colors in console -->
<arg value="-colors"/>
<!-- Show sniff codes in all reports -->
<arg value="ns"/>
<arg value="ps"/>
<!--
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" />
<rule ref="PHPCompatibilityWP" />
<config name="7.1-" />
<rule ref="WordPress-Core">
<!-- PSR4 -->
<exclude name="WordPress.Files.FileName"/>
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
</rule>
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="4"/>
<property name="absoluteComplexity" value="6"/>
</properties>
</rule>
<rule ref="Generic.Metrics.NestingLevel">
<properties>
<property name="absoluteNestingLevel" value="3"/>
</properties>
</rule>
<!-- exclude the 'empty' index files from some documentation checks -->
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>*/index.php</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment.WrongStyle">
<exclude-pattern>*/index.php</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.InlineComment.SpacingAfter">
<exclude-pattern>*/index.php</exclude-pattern>
</rule>
<!-- disallow Yoda comparisons -->
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison" />
</ruleset>