-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
86 lines (67 loc) · 3.01 KB
/
phpcs.xml.dist
File metadata and controls
86 lines (67 loc) · 3.01 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
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards">
<description>Apply WordPress Coding Standards</description>
<!-- Only scan PHP files. -->
<arg name="extensions" value="php"/>
<!-- Set the memory limit to 512M.
For most standard PHP configurations, this means the memory limit will temporarily be raised.
Ref: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#specifying-phpini-settings
-->
<ini name="memory_limit" value="512M"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="20"/>
<!-- Show sniff codes in all reports. -->
<arg value="ps"/>
<!--
#############################################################################
FILE SELECTION
Set which files will be subject to the scans executed using this ruleset.
#############################################################################
-->
<file>.</file>
<!-- Directories and third party library exclusions. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/build/*</exclude-pattern>
<exclude-pattern>/wordpress/*</exclude-pattern>
<exclude-pattern>/packages/plugin-sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-crosscheck-db.php</exclude-pattern>
<!--
#############################################################################
SET UP THE RULESET
#############################################################################
-->
<rule ref="WordPress-Core"/>
<!--
#############################################################################
SNIFF-SPECIFIC CONFIGURATION
#############################################################################
-->
<!--
#############################################################################
SELECTIVE EXCLUSIONS
Exclude specific files for specific sniffs and/or exclude sub-groups in sniffs.
These exclusions are listed ordered by alphabetic sniff name.
#############################################################################
-->
<rule ref="WordPress.DB.RestrictedClasses.mysql__PDO">
<exclude-pattern>/packages/plugin-sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php</exclude-pattern>
<exclude-pattern>/packages/mysql-on-sqlite/src/sqlite/*\.php</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.DB.RestrictedClasses">
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
<!-- Assignments in while conditions are a valid method of looping over iterables. -->
<rule ref="Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Exclude the unit tests from the file name rules. -->
<rule ref="WordPress.Files.FileName">
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase">
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
</ruleset>