forked from wpxpertise/notifier-to-slack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpcs.xml
171 lines (133 loc) · 4.9 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version="1.0" ?>
<!--
WPPOOL Coding Standard
@package WPPOOL_CS
@version 1.0.0
-->
<ruleset name="WPPOOLCS">
<description>WPPOOL Coding Standard</description>
<!-- Excludes -->
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<!--
#### ####
#### No Need to Modify ####
#### ####
-->
<!-- Scan all files in directory -->
<file>.</file>
<!-- Scan only PHP files -->
<arg name="extensions" value="php" />
<!-- Show progress -->
<arg value="ps" />
<!-- Show colors in console -->
<arg name="colors" />
<!-- Paraller file checking -->
<arg name="parallel" value="20" />
<!-- Show sniff codes in all reports -->
<arg value="ns" />
<!--
#### ####
#### PHP Rulesets ####
#### ####
-->
<!-- Minimum version of PHP required to run the plugin. -->
<config name="testVersion" value="5.6-" />
<!-- Check PHP version compatibility. -->
<!-- <rule ref="PHPCompatibility" /> -->
<!-- Allow tab indent -->
<rule ref="Generic.WhiteSpace.DisallowTabIndent">
<exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsed" />
</rule>
<!-- Generic.Arrays.DisallowLongArraySyntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<!-- Allow short array syntax -->
<rule ref="Generic.Arrays.DisallowShortArraySyntax">
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
</rule>
<!-- Generic.Commenting -->
<rule ref="Generic.Commenting" />
<!-- Generic.CodeAnalysis -->
<rule ref="Generic.CodeAnalysis" />
<!-- spacing and indentation -->
<rule ref="Generic.WhiteSpace" />
<!-- whitespace in function arguements -->
<rule ref="Generic.Functions.FunctionCallArgumentSpacing">
<exclude
name="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma"
/>
</rule>
<!-- ignore Generic.Files.EndFileNewline.NotFound -->
<rule ref="Generic.Files.EndFileNewline">
<exclude name="Generic.Files.EndFileNewline.NotFound" />
</rule>
<!-- Nested level of condition is 3 ro reduce code complexity -->
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall">
<properties>
<property name="maxNestedLevel" value="3" />
</properties>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine" />
<!-- Check class exists -->
<rule ref="Generic.Classes.DuplicateClassName">
<type>warning</type>
</rule>
<!-- Missing Package Tag -->
<rule ref="Squiz.Commenting.FileComment.MissingPackageTag" />
<rule ref="Squiz.Commenting.FileComment.Missing" />
<!-- Squize -->
<rule
ref="Squiz.Classes.ClassFileName"
/> <!-- Class name doesn't match filename -->
<rule ref="Squiz.Classes.ValidClassName" /> <!-- Valid class name -->
<rule
ref="Squiz.Commenting.FunctionCommentThrowTag.Missing"
/> <!-- Missing @throws tag in function comment -->
<rule
ref="Squiz.Commenting.FileComment.Missing"
/> <!-- Missing file doc comment -->
<!-- Ignore class name validation -->
<rule ref="Squiz.Classes.ValidClassName">
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
</rule>
<!-- Squiz.Classes.ClassFileName -->
<rule ref="Squiz.Classes.ClassFileName">
<exclude name="Squiz.Classes.ClassFileName.NoMatch" />
</rule>
<!--
#### ####
#### WordPress Rulesets ####
#### ####
-->
<config name="minimum_supported_wp_version" value="5.2" />
<!-- WordPress; WordPress Standard, Security, Files, Docs, Extra Everything -->
<rule ref="WordPress" />
<rule ref="WordPress-Core" />
<rule ref="WordPress-Docs" />
<rule ref="WordPress-Extra" />
<!-- Allow short ternary (codition ? true : false) -->
<rule ref="WordPress.PHP.DisallowShortTernary.Found" />
<!-- exclude WordPress InvalidClassFileName -->
<rule ref="WordPress.Files.FileName">
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodDoubleUnderscore" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid" />
<exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase" />
</rule>
<!-- exclude WordPress InvalidClassFileName -->
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
</rule>
<!-- exclude WordPress.PHP.StrictInArray.FoundNonStrictFalse -->
<rule ref="WordPress.PHP.StrictInArray">
<exclude name="WordPress.PHP.StrictInArray.FoundNonStrictFalse" />
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict" />
</rule>
<!--
#### ####
#### End of WPPOOL Coding Standard ####
#### ####
-->
</ruleset>