-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.phpcs.xml.dist
More file actions
87 lines (71 loc) · 2.97 KB
/
.phpcs.xml.dist
File metadata and controls
87 lines (71 loc) · 2.97 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
<?xml version="1.0"?>
<ruleset name="Ops Health Dashboard">
<description>WordPress Coding Standards for Ops Health Dashboard</description>
<!-- Check all PHP files in directory tree by default. -->
<arg name="extensions" value="php"/>
<file>.</file>
<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>
<!-- Show colors in output -->
<arg name="colors"/>
<!-- Exclude paths -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/bin/*</exclude-pattern>
<exclude-pattern>*/.phpstan-cache/*</exclude-pattern>
<!-- Use WordPress Coding Standards -->
<rule ref="WordPress">
<!-- Allow short array syntax -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<!-- Exclude filename check (we use PSR-4 with PascalCase) -->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<!-- Exclude escape output for exceptions -->
<exclude name="WordPress.Security.EscapeOutput.ExceptionNotEscaped"/>
<!-- Allow reserved keywords as parameter names (technical terms in DI) -->
<exclude name="Universal.NamingConventions.NoReservedKeywordParameterNames"/>
</rule>
<!-- Use WordPress-Extra for additional checks -->
<rule ref="WordPress-Extra">
<!-- Exclude translation text domain check for now -->
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
</rule>
<!-- Use WordPress-Docs for documentation standards -->
<rule ref="WordPress-Docs"/>
<!-- Enforce short array syntax [] instead of array() -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Check for PHP cross-version compatibility -->
<config name="testVersion" value="7.4-"/>
<rule ref="PHPCompatibilityWP"/>
<!-- Verify text domain -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="ops-health-dashboard"/>
</property>
</properties>
</rule>
<!-- Naming conventions -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="ops_health"/>
<element value="OpsHealthDashboard"/>
</property>
</properties>
</rule>
<!-- Allow PSR-4 autoloading standard -->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false"/>
</properties>
</rule>
<!-- Line length -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="150"/>
</properties>
</rule>
</ruleset>