-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpcs.xml
67 lines (56 loc) · 2.04 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
<?xml version="1.0"?>
<ruleset name="CS">
<description>Custom coding standards.</description>
<config name="testVersion" value="5.6-"/>
<!-- Scan all files in directory -->
<file>./web/app</file>
<!-- Scan only PHP files -->
<arg name="extensions" value="php"/>
<arg name="colors"/>
<arg name="parallel" value="100"/>
<arg name="cache" value=".phpcs.cache"/>
<!-- Ignore WordPress and Composer dependencies -->
<exclude-pattern>\.codeception/*</exclude-pattern>
<exclude-pattern>\.github/*</exclude-pattern>
<exclude-pattern>web/wp</exclude-pattern>
<exclude-pattern>web/app/themes/twentytwentythree/</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>node_modues/*</exclude-pattern>
<exclude-pattern>assets/*</exclude-pattern>
<!-- Show colors in console -->
<arg value="-colors"/>
<!-- Show sniff codes in all reports -->
<arg value="ns"/>
<arg value="ps"/>
<rule ref="PHPCompatibilityWP" />
<config name="7.1-" />
<rule ref="WordPress-Core">
<!-- PSR4 -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<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>