-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpcs.xml.dist
82 lines (68 loc) · 3.15 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
81
82
<?xml version="1.0"?>
<ruleset name="Kanopi Components" namespace="Kanopi\Components">
<description>Kanopi Components Core PHPCS Ruleset</description>
<!-- Enable progress bar -->
<arg value="ps"/>
<!-- Limits scope to PHP files only -->
<arg name="extensions" value="php"/>
<!-- Enables reporting of all warnings and errors -->
<arg name="severity" value="1"/>
<!--
Suppress errors thrown by WordPress Coding Standards when run on PHP 8.0+.
See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
-->
<ini name="error_reporting" value="E_ALL & ~E_DEPRECATED"/>
<include-pattern>/src/**/*</include-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<!-- Include WordPress rule sets with the following Exceptions -->
<rule ref="WordPress">
<!-- Disables the conversion of short array to long array -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<!-- Disables a few WordPress Core opinionated comment related rules, like requiring punctuation -->
<exclude name="Generic.Commenting.DocComment"/>
<exclude name="Squiz.Commenting.FileComment"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Squiz.Commenting.FunctionComment.ThrowsNoFullStop"/>
<!-- Allows camel-case variable names instead of enforcing snake case -->
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
</rule>
<rule ref="Squiz.ControlStructures.ControlSignature">
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" />
</rule>
<!-- Use {@inheritDoc} for inheriting function parameter and return descriptions from ancestor classes -->
<rule ref="Squiz.Commenting.FunctionComment">
<properties>
<property name="skipIfInheritdoc" value="true"/>
</properties>
</rule>
<!-- Convert all long arrays to short array syntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Ignore white-space in Comments and Inline HTML -->
<rule ref="Universal.WhiteSpace.PrecisionAlignment">
<properties>
<property name="ignoreAlignmentBefore" type="array"
value="T_COMMENT,T_INLINE_HTML,T_DOC_COMMENT_WHITESPACE"/>
</properties>
</rule>
<!-- Use WordPress-VIP-Go as the base PHPCS ruleset -->
<rule ref="WordPress-VIP-Go"/>
<!-- Ignore WordPress File Naming for PSR-4 Namespaces -->
<rule ref="WordPress.Files">
<exclude-pattern>/src/**/*</exclude-pattern>
<exclude-pattern>/tests/**/*</exclude-pattern>
</rule>
<!-- Ignore WordPress Function Naming for PSR-4 code -->
<rule ref="WordPress.NamingConventions.ValidFunctionName">
<exclude-pattern>/src/**/*</exclude-pattern>
<exclude-pattern>/tests/**/*</exclude-pattern>
</rule>
<!-- Only process WordPress output security for WordPress specific classes -->
<rule ref="WordPress.Security">
<include-pattern>/src/Logger/WordPress/**/*</include-pattern>
<include-pattern>/src/Model/Data/WordPress/**/*</include-pattern>
<include-pattern>/src/Repositories/WordPress/**/*</include-pattern>
<include-pattern>/src/Services/System/WordPress/**/*</include-pattern>
<exclude-pattern>/src/**/*</exclude-pattern>
</rule>
</ruleset>