-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy path.phpcs.xml.dist
More file actions
99 lines (76 loc) · 3.54 KB
/
.phpcs.xml.dist
File metadata and controls
99 lines (76 loc) · 3.54 KB
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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="Patchwork"
xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Patchwork rules for PHP_CodeSniffer</description>
<!--
#############################################################################
COMMAND LINE ARGUMENTS
https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset
#############################################################################
-->
<!-- Scan all files. -->
<file>.</file>
<!-- Third party files and build files don't need to comply with these coding standards. -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<!-- Test fixtures don't need to comply with these coding standards
as we may be specifically testing a variation in how syntax can be written.
-->
<exclude-pattern>*/tests/includes/*</exclude-pattern>
<!-- Only check PHP files.
Note: at this time PHPCS can not scan .phpt files.
There is a feature request open to change this.
https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/1363
-->
<arg name="extensions" value="php"/>
<!-- Show progress, show the error codes for each message (source). -->
<arg value="ps"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>
<!--
#############################################################################
CHECK FOR PHP CROSS-VERSION COMPATIBILITY
#############################################################################
-->
<config name="testVersion" value="7.1-"/>
<rule ref="PHPCompatibility"/>
<!--
#############################################################################
FOLLOW PSR12 for CODING STYLE
#############################################################################
-->
<rule ref="PSR12">
<!-- Re-organising the files should be a separate consideration and needs discussion
about whether or not to adopt PSR-4 or another convention.
-->
<exclude name="PSR1.Files.SideEffects"/>
<exclude name="PSR1.Classes.ClassDeclaration.MultipleClasses"/>
</rule>
<!--
#############################################################################
SNIFF SPECIFIC CONFIGURATION
#############################################################################
-->
<!-- Allow for slightly longer line length than PSR12 (120) allows for. -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="140" />
</properties>
</rule>
<!--
#############################################################################
SELECTIVE EXCLUSIONS
Exclude specific files for specific sniffs.
#############################################################################
-->
<!-- Renaming these methods from snake_case to camelCaps would be a BC-break. -->
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>/src/CodeManipulation/Stream\.php$</exclude-pattern>
</rule>
<!-- Renaming these constants from camelCaps to ALL_CAPPS would be a BC-break. -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase">
<exclude-pattern>/src/CodeManipulation/Actions/RedefinitionOfNew\.php$</exclude-pattern>
</rule>
</ruleset>