forked from unfulvio/wp-php-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
135 lines (114 loc) · 4.6 KB
/
Copy pathphpcs.xml
File metadata and controls
135 lines (114 loc) · 4.6 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
<?xml version="1.0"?>
<ruleset lwdt="202602062000" name="WordPress + WooCommerce Coding Standards">
<description>WordPress and WooCommerce coding standards with PHPCompatibility.Optimized for plugins.</description>
<!-- ==========================================================
Paths to ignore
========================================================== -->
<exclude-pattern>tests/</exclude-pattern>
<exclude-pattern>assets/</exclude-pattern>
<exclude-pattern>node_modules/</exclude-pattern>
<exclude-pattern>vendor/</exclude-pattern>
<exclude-pattern>build/</exclude-pattern>
<exclude-pattern>playwright-report/</exclude-pattern>
<!-- ==========================================================
Runtime configuration
========================================================== -->
<config name="minimum_wp_version" value="6.5"/>
<config name="testVersion" value="7.4-"/>
<arg name="extensions" value="php"/>
<arg value="ps"/>
<arg name="colors"/>
<arg name="parallel" value="50"/>
<arg name="basepath" value="."/>
<!-- ==========================================================
Core WordPress Standards (DO NOT fight these)
========================================================== -->
<rule ref="WordPress-Core"/>
<rule ref="WordPress-Extra"/>
<rule ref="WordPress-Docs"/>
<!-- ==========================================================
WooCommerce Standards
========================================================== -->
<rule ref="WooCommerce-Core"/>
<rule ref="WooCommerce">
<!-- Hooks documentation is noisy in large plugins -->
<exclude name="WooCommerce.Commenting.CommentHooks.MissingHookComment"/>
</rule>
<!-- ==========================================================
Internationalization
========================================================== -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="wp-php-console"/>
</property>
</properties>
</rule>
<!-- ==========================================================
Database & SQL
========================================================== -->
<rule ref="WordPress.DB.PreparedSQL"/>
<rule ref="WordPress.DB.PreparedSQLPlaceholders"/>
<!-- ==========================================================
Security (DO NOT disable)
========================================================== -->
<rule ref="WordPress.Security"/>
<!-- Allow WooCommerce sanitizer -->
<rule ref="WordPress.Security.ValidatedSanitizedInput">
<properties>
<property name="customSanitizingFunctions" type="array">
<element value="wc_clean"/>
</property>
</properties>
</rule>
<!-- ==========================================================
Naming & Prefixing
========================================================== -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"/>
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="custom_capabilities" type="array">
<element value="manage_woocommerce"/>
<element value="delete_published_products"/>
</property>
</properties>
</rule>
<!-- ==========================================================
Files & Formatting
========================================================== -->
<rule ref="WordPress.Files.FileName"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
</properties>
</rule>
<arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<!-- ==========================================================
PHP Compatibility
========================================================== -->
<rule ref="PHPCompatibility"/>
<!-- ==========================================================
Forbidden / Dangerous Constructs
========================================================== -->
<rule ref="Squiz.PHP.Eval.Discouraged">
<type>error</type>
</rule>
<rule ref="Generic.PHP.DiscourageGoto">
<type>error</type>
</rule>
<rule ref="WordPress.PHP.RestrictedPHPFunctions"/>
<rule ref="WordPress.PHP.NoSilencedErrors"/>
<!-- ==========================================================
Misc Quality Rules
========================================================== -->
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.DisallowAlternativePHPTags"/>
<!-- Avoid noisy variable false positives -->
<rule ref="VariableAnalysis">
<exclude name="VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable"/>
<exclude name="VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable"/>
</rule>
</ruleset>