-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
118 lines (97 loc) · 4.03 KB
/
phpcs.xml
File metadata and controls
118 lines (97 loc) · 4.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
<?xml version="1.0"?>
<ruleset name="WordPress Plugin Coding Standards">
<description>WordPress coding standards</description>
<!-- Files to check -->
<file>.</file>
<!-- Exclude patterns -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/assets/*</exclude-pattern>
<exclude-pattern>*/languages/*</exclude-pattern>
<exclude-pattern>*/.git/*</exclude-pattern>
<exclude-pattern>*/.github/*</exclude-pattern>
<!-- Use WordPress coding standards -->
<rule ref="WordPress">
<!-- Allow short array syntax [] instead of array() -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<!-- Allow longer lines for readability -->
<exclude name="Generic.Files.LineLength"/>
<!-- Allow direct database queries when using $wpdb properly -->
<exclude name="WordPress.DB.DirectDatabaseQuery"/>
</rule>
<!-- COMMENTED OUT: These rules enforce spaces instead of tabs, which conflicts with WordPress standards -->
<!-- WordPress standards actually require TABS for indentation, not spaces -->
<!--
<rule ref="Generic.WhiteSpace.DisallowTabIndent">
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="false"/>
</properties>
</rule>
-->
<!-- COMMENTED OUT: Disallow Rule Flagging Space Indents - not needed with tab indentation -->
<!--
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent">
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent"/>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed">
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed"/>
</rule>
-->
<!-- COMMENTED OUT: Disallow inline tabs - WordPress allows tabs for indentation -->
<!--
<rule ref="Universal.WhiteSpace.DisallowInlineTabs">
</rule>
-->
<!-- Additional WordPress-specific spacing rules -->
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing"/>
<rule ref="WordPress.WhiteSpace.OperatorSpacing"/>
<!-- Enforce WordPress indentation standards -->
<rule ref="WordPress.Arrays.ArrayIndentation"/>
<rule ref="WordPress.Arrays.MultipleStatementAlignment"/>
<!-- WordPress function call formatting -->
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="allowMultipleArguments" value="false"/>
</properties>
</rule>
<!-- WordPress class and method formatting -->
<rule ref="PSR2.Classes.ClassDeclaration"/>
<rule ref="PSR2.Methods.MethodDeclaration"/>
<!-- File formatting -->
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>
<!-- WordPress security and best practices -->
<rule ref="WordPress.Security"/>
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Set the text domain for internationalization -->
<property name="text_domain" type="array">
<element value="enginescript-site-optimizer"/>
</property>
</properties>
</rule>
<!-- WordPress naming conventions (snake_case) -->
<rule ref="WordPress.NamingConventions.ValidFunctionName"/>
<rule ref="WordPress.NamingConventions.ValidVariableName"/>
<rule ref="WordPress.NamingConventions.ValidHookName"/>
<!-- WordPress PHP compatibility -->
<rule ref="PHPCompatibilityWP">
<include-pattern>*\.php$</include-pattern>
</rule>
<config name="minimum_supported_wp_version" value="6.5"/>
<config name="testVersion" value="7.4-"/>
<!-- Show progress -->
<arg value="p"/>
<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- Use colors in output -->
<arg name="colors"/>
</ruleset>