-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
.phpcs.xml.dist
84 lines (66 loc) · 3.29 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
83
84
<?xml version="1.0"?>
<ruleset name="PHP Cheatsheets">
<description>PHP Cheatsheets rules for PHP_CodeSniffer</description>
<arg value="sp"/>
<arg name="extensions" value="php"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check 8 files simultanously. -->
<arg name="parallel" value="8"/>
<file>.</file>
<exclude-pattern>/include/PHP-cast-to-type/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- PHP cross-version compatibility -->
<config name="testVersion" value="4.3-"/>
<rule ref="PHPCompatibility">
<!-- Exclude notices about constants which are back-filled. -->
<exclude name="PHPCompatibility.Constants.NewConstants.php_eolFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.php_version_idFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.e_strictFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.e_recoverable_errorFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.e_deprecatedFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.e_user_deprecatedFound"/>
</rule>
<rule ref="WordPress">
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
<!-- else on new line is perfectly fine -->
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" />
<!-- just like using else if... -->
<exclude name="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
<!-- Syntax is already being checked on travis build. -->
<exclude name="Generic.PHP.Syntax"/>
<!-- Demanding Yoda conditions is stupid. -->
<exclude name="WordPress.PHP.YodaConditions"/>
<!-- WP specific sniffs which should be ignored -->
<exclude name="WordPress.Security" />
<exclude name="WordPress.WP" />
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.PHP.DevelopmentFunctions" />
<exclude name="WordPress.PHP.DiscouragedPHPFunctions" />
<exclude name="WordPress.PHP.IniSet" />
<!-- Exclude a number of rules for being over-zealous for this codebase. -->
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
<!-- Declaring scope would break PHP4 compatibility. -->
<exclude name="PSR2.Classes.PropertyDeclaration"/>
<exclude name="Squiz.Scope.MethodScope"/>
</rule>
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<!-- No need to adjust alignment of large arrays when the item with the largest key is removed. -->
<property name="exact" value="false"/>
<!-- Don't align multi-line items if ALL items in the array are multi-line. -->
<!--<property name="alignMultilineItems" value="!=100"/>-->
<!-- Array Assignment operator should always be on the same line as the array key. -->
<property name="ignoreNewlines" value="false"/>
</properties>
<!-- Partially addressed, not going to change this all now. Wait for refactor. -->
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned"/>
</rule>
<!-- exclude the 'empty' index files from some documentation checks -->
<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>-->
</ruleset>