-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
89 lines (68 loc) · 2.96 KB
/
phpcs.xml.dist
File metadata and controls
89 lines (68 loc) · 2.96 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
<?xml version="1.0"?>
<ruleset name="FAIR CLI WordPress Coding Standards">
<description>A custom set of rules to check for the FAIR CLI project based on WordPress Coding Standards.</description>
<!-- What to scan -->
<file>./src</file>
<file>./tests</file>
<!-- Exclude vendor directory -->
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>
<arg name="colors"/>
<!-- Set default encoding -->
<arg name="encoding" value="utf-8"/>
<!-- Check for cross-platform compatibility -->
<config name="testVersion" value="8.0-"/>
<!-- Use WordPress Coding Standards -->
<rule ref="WordPress">
<!-- Allow short array syntax -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<!-- Allow PSR-4 style namespaces in tests -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<!-- We use class-name.php naming which is WP style -->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<!-- Allow short ternary -->
<exclude name="Universal.Operators.DisallowShortTernary"/>
<!-- CLI tool doesn't need text domain -->
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
<exclude name="WordPress.WP.I18n.NonSingularStringLiteralText"/>
<!-- Not a WordPress plugin, so no escaping needed for CLI output -->
<exclude name="WordPress.Security.EscapeOutput"/>
<!-- Allow direct database queries for our custom client -->
<exclude name="WordPress.DB.DirectDatabaseQuery"/>
<!-- Not using WordPress nonces in CLI tool -->
<exclude name="WordPress.Security.NonceVerification"/>
<!-- Allow file operations in CLI tool -->
<exclude name="WordPress.WP.AlternativeFunctions"/>
<!-- Allow error silencing where appropriate -->
<exclude name="WordPress.PHP.NoSilencedErrors"/>
</rule>
<!-- Use WordPress-Extra for additional checks -->
<rule ref="WordPress-Extra">
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
</rule>
<!-- Use WordPress-Docs for documentation standards -->
<rule ref="WordPress-Docs"/>
<!-- Verify that everything is properly documented -->
<rule ref="Squiz.Commenting.FunctionComment">
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Squiz.Commenting.FunctionComment.ThrowsNoFullStop"/>
</rule>
<!-- PHPUnit test methods don't need doc blocks -->
<rule ref="Squiz.Commenting.FunctionComment.Missing">
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
<!-- Allow test methods without comments -->
<rule ref="Squiz.Commenting.FunctionCommentThrowTag.Missing">
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
<!-- Tests can have longer lines for readability -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="200"/>
</properties>
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
</ruleset>