This repository was archived by the owner on Mar 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
139 lines (113 loc) · 5.03 KB
/
phpcs.xml.dist
File metadata and controls
139 lines (113 loc) · 5.03 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?xml version="1.0"?>
<ruleset name="Deploy Forge Coding Standards">
<description>WordPress Coding Standards for Deploy Forge plugin.</description>
<!-- What to scan -->
<file>deploy-forge</file>
<!-- Exclude vendor directory -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<!-- Exclude tests directory - PHPUnit tests follow PSR-4 conventions, not WPCS -->
<exclude-pattern>/tests/*</exclude-pattern>
<!-- Exclude JavaScript files - use ESLint for JS linting instead -->
<exclude-pattern>*.js</exclude-pattern>
<!-- Show progress -->
<arg value="ps"/>
<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- Strip the file paths down to the relevant bit -->
<arg name="basepath" value="."/>
<!-- Check up to 8 files simultaneously -->
<arg name="parallel" value="8"/>
<!-- Use colors in output -->
<arg name="colors"/>
<!-- Set encoding -->
<arg name="encoding" value="utf-8"/>
<!-- Check for PHP cross-version compatibility -->
<config name="testVersion" value="8.0-"/>
<!-- WordPress Coding Standards -->
<rule ref="WordPress">
<!-- Allow short array syntax since we're PHP 8.0+ -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<!-- Allow union type hints (PHP 8.0 feature) -->
<exclude name="Universal.Operators.DisallowShortTernary"/>
</rule>
<!-- Allow direct database queries for custom deployment table -->
<rule ref="WordPress.DB.DirectDatabaseQuery">
<exclude-pattern>*/includes/class-database.php</exclude-pattern>
<exclude-pattern>*/includes/class-deployment-manager.php</exclude-pattern>
<exclude-pattern>*/includes/class-webhook-handler.php</exclude-pattern>
</rule>
<!-- Allow table name interpolation (WordPress limitation - can't use placeholders for table names) -->
<rule ref="WordPress.DB.PreparedSQL.InterpolatedNotPrepared">
<exclude-pattern>*/includes/class-database.php</exclude-pattern>
<exclude-pattern>*/includes/class-deployment-manager.php</exclude-pattern>
<exclude-pattern>*/includes/class-webhook-handler.php</exclude-pattern>
</rule>
<!-- Allow error_log for debugging functionality -->
<rule ref="WordPress.PHP.DevelopmentFunctions.error_log_error_log">
<exclude-pattern>*/includes/class-debug-logger.php</exclude-pattern>
<exclude-pattern>*/includes/class-settings.php</exclude-pattern>
<exclude-pattern>*/includes/class-deployment-manager.php</exclude-pattern>
<exclude-pattern>*/includes/class-webhook-handler.php</exclude-pattern>
</rule>
<!-- Allow silenced errors for non-critical functions -->
<rule ref="WordPress.PHP.NoSilencedErrors.Discouraged">
<exclude-pattern>*/includes/class-deployment-manager.php</exclude-pattern>
<exclude-pattern>*/includes/class-webhook-handler.php</exclude-pattern>
</rule>
<!-- Allow mixed OO and functions in main plugin file (WordPress plugin pattern) -->
<rule ref="Universal.Files.SeparateFunctionsFromOO.Mixed">
<exclude-pattern>*/deploy-forge.php</exclude-pattern>
</rule>
<!-- Templates use local scope variables - not truly global -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound">
<exclude-pattern>*/templates/*</exclude-pattern>
</rule>
<!-- Allow direct file system operations for theme deployment -->
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_mkdir">
<exclude-pattern>*/includes/class-deployment-manager.php</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_rmdir">
<exclude-pattern>*/includes/class-deployment-manager.php</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_chmod">
<exclude-pattern>*/includes/class-deployment-manager.php</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.unlink_unlink">
<exclude-pattern>*/includes/class-deployment-manager.php</exclude-pattern>
</rule>
<!-- Allow "default" parameter name (common convention) -->
<rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames.defaultFound">
<severity>0</severity>
</rule>
<!-- WordPress-Extra provides additional rules -->
<rule ref="WordPress-Extra"/>
<!-- WordPress-Docs for documentation standards -->
<rule ref="WordPress-Docs"/>
<!-- Minimum supported WordPress version -->
<config name="minimum_wp_version" value="5.8"/>
<!-- Text domain for internationalization -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="deploy-forge"/>
</property>
</properties>
</rule>
<!-- Prefix for hooks, functions, classes -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="deploy_forge"/>
<element value="Deploy_Forge"/>
</property>
</properties>
</rule>
<!-- Allow file name exceptions for main plugin file -->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false"/>
</properties>
<exclude-pattern>deploy-forge/deploy-forge.php</exclude-pattern>
</rule>
</ruleset>