-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpcs.xml
83 lines (70 loc) · 3.22 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
<?xml version="1.0"?>
<ruleset name="Saltus">
<description>Saltus Coding Standards.</description>
<exclude-pattern>*/phpunit.xml*</exclude-pattern>
<exclude-pattern>*/languages/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>lib/*</exclude-pattern>
<rule ref="WordPress-Extra">
<!-- # files -->
<!-- Ignore lowercase filenames -->
<exclude name="Generic.Files.LowercasedFilename.NotFound"/>
<!-- Do not enforce 'class-' prefix and hyffens -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<!-- # WP VIP: Generates too many false positives -->
<exclude name="WordPress.WP.CapitalPDangit.Misspelled"/>
<exclude name="WordPress.WP.CapitalPDangit.MisspelledInComment"/>
<!-- # wp nonsense -->
<!-- ignore yoda -->
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
<!-- too many rules -->
<exclude name="PEAR.Functions.FunctionCallSignature.requiredSpacesAfterOpen"/>
<exclude name="PEAR.Functions.FunctionCallSignature.requiredSpacesBeforeClose"/>
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"/>
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine"/>
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"/>
<!-- Allow ternary forms -->
<exclude name="Universal.Operators.DisallowShortTernary.Found"/>
<!-- Prefer [] instead of array() -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>
<exclude name="Generic.Arrays.DisallowLongArraySyntax.Found"/>
<!-- common -->
<exclude name="PSR2.Classes.ClassDeclaration.ImplementsLine"/>
<exclude name="PSR2.Classes.ClassDeclaration.ExtendsLine"/>
</rule>
<!-- Add extra word delimiter for hooks. -->
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="/"/>
</properties>
</rule>
<!-- # from yoast: https://github.com/Yoast/yoastcs/blob/develop/Yoast/ruleset.xml -->
<!-- If a conscious choice has been made for a non-strict comparison, that's ok.
I.e. when `strict` has been explicitely set to `false` in an array comparison,
it will be allowed. -->
<exclude name="WordPress.PHP.StrictInArray.FoundNonStrictFalse"/>
<!-- In contrast to WPCS: disallow Yoda conditions. (PHPCS 3.5.0) -->
<rule ref="Generic.ControlStructures.DisallowYodaConditions"/>
<!-- # code quality -->
<!-- cyclomatic -->
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="10"/>
<property name="absoluteComplexity" value="20"/>
</properties>
</rule>
<!-- php compat -->
<rule ref="PHPCompatibility"/>
<!-- phpcs parameters -->
<file>./src/</file>
<arg name="extensions" value="php" />
<arg name="encoding" value="UTF-8" />
<arg value="ps"/>
<arg name="colors"/>
<arg name="parallel" value="12"/>
<config name="testVersion" value="7.0-"/>
<config name="installed_paths" value="/srv/dev/coding_standards/wpcs/,/srv/dev/coding_standards/PHPCSUtils/,/srv/dev/coding_standards/PHPCSExtra/,/srv/dev/coding_standards/PHPCompatibility" />
</ruleset>