-
Notifications
You must be signed in to change notification settings - Fork 205
/
phpcs.xml.dist
executable file
·210 lines (202 loc) · 9.59 KB
/
phpcs.xml.dist
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Dokan">
<description>Generally-applicable sniffs for WordPress plugins.</description>
<!-- What to scan -->
<file>.</file>
<exclude-pattern type="relative">^/\.git/*</exclude-pattern>
<exclude-pattern type="relative">^/\.githooks/*</exclude-pattern>
<exclude-pattern type="relative">^/\.make/*</exclude-pattern>
<exclude-pattern type="relative">*\.asset\.php$</exclude-pattern>
<exclude-pattern type="relative">^/assets/*</exclude-pattern>
<exclude-pattern type="relative">^/src/*</exclude-pattern>
<exclude-pattern type="relative">^/lib/*</exclude-pattern>
<exclude-pattern type="relative">^/dist/*</exclude-pattern>
<exclude-pattern type="relative">^/build/*</exclude-pattern>
<exclude-pattern type="relative">^/node_modules/*</exclude-pattern>
<exclude-pattern type="relative">^/vendor/*</exclude-pattern>
<exclude-pattern type="relative">(^includes)(\/vendor)</exclude-pattern>
<exclude-pattern type="relative">^/tests/*</exclude-pattern>
<exclude-pattern type="relative">^/dependencies/*</exclude-pattern>
<exclude-pattern type="relative">*\.twig$</exclude-pattern>
<exclude-pattern type="relative">*\.css$</exclude-pattern>
<exclude-pattern type="relative">*\.scss$</exclude-pattern>
<exclude-pattern type="relative">^/languages/*</exclude-pattern>
<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="12"/><!-- Enables parallel processing when available for faster results. -->
<!-- Rules: Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="7.4-"/>
<!-- Rules: Check PHP version compatibility-->
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>
<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="6.4"/>
<rule ref="WordPress-Extra"/>
<rule ref="WordPress">
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent"/>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="dokan-lite"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>
<rule ref="Squiz.Commenting">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.MultipleArguments">
<severity>0</severity>
</rule>
<rule ref="Generic.Commenting.DocComment.SpacingBeforeTags">
<severity>0</severity>
</rule>
<rule ref="WordPress.Files.FileName">
<severity>0</severity>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions">
<severity>0</severity>
</rule>
<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
<severity>0</severity>
</rule>
<rule ref="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned">
<severity>0</severity>
</rule>
<rule ref="Generic.Formatting.MultipleStatementAlignment.NotSameWarning">
<severity>0</severity>
</rule>
<rule ref="Generic.Commenting.DocComment.MissingShort">
<severity>0</severity>
</rule>
<rule ref="WordPress.PHP.YodaConditions.NotYoda">
<severity>0</severity>
</rule>
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace">
<severity>0</severity>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterCloseParenthesis">
<severity>0</severity>
</rule>
<rule ref="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound">
<type>warning</type>
</rule>
<rule ref="WordPress.DB.DirectDatabaseQuery.NoCaching">
<severity>0</severity>
</rule>
<rule ref="WordPress.PHP.StrictInArray.MissingTrueStrict">
<type>error</type>
</rule>
<rule ref="Universal.Operators.StrictComparisons">
<type>error</type>
</rule>
<rule ref="WordPress.DB.DirectDatabaseQuery.DirectQuery">
<severity>0</severity>
</rule>
<rule ref="WordPress.DB.PreparedSQL.NotPrepared">
<type>warning</type>
</rule>
<rule ref="WordPress.Security.EscapeOutput.OutputNotEscaped">
<severity>0</severity>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions.error_log_var_export">
<severity>0</severity>
</rule>
<rule ref="Universal.Arrays.DisallowShortArraySyntax">
<severity>0</severity>
</rule>
<!-- Ref: https://github.com/WordPress/WordPress-Coding-Standards/wiki/Sanitizing-array-input-data -->
<rule ref="WordPress.Security.ValidatedSanitizedInput">
<properties>
<property name="customSanitizingFunctions" type="array">
<element value="wc_clean"/>
<element value="wc_esc_json"/>
<element value="dokan_sanitize_phone_number"/>
</property>
</properties>
</rule>
<rule ref="Squiz.PHP.CommentedOutCode.Found">
<severity>0</severity>
</rule>
<!-- Define the custom capability for woocommerce -->
<!-- Ref: https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/phpcs.xml#L57 -->
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="custom_capabilities" type="array">
<element value="download_file"/>
<element value="read_product"/>
<element value="edit_products"/>
<element value="edit_private_products"/>
<element value="edit_others_products"/>
<element value="edit_product"/>
<element value="publish_shop_orders"/>
<element value="edit_shop_orders"/>
<element value="edit_others_shop_orders"/>
<element value="view_order"/>
<element value="pay_for_order"/>
<element value="order_again"/>
<element value="cancel_order"/>
<element value="read_private_shop_orders"/>
<element value="customer"/>
<element value="manage_woocommerce"/>
<element value="manage_product_terms"/>
<element value="view_woocommerce_reports"/>
<element value="dokandar"/>
<element value="dokan_view_sales_overview"/>
<element value="dokan_view_sales_report_chart"/>
<element value="dokan_view_announcement"/>
<element value="dokan_view_order_report"/>
<element value="dokan_view_review_reports"/>
<element value="dokan_view_product_status_report"/>
<element value="dokan_view_overview_report"/>
<element value="dokan_view_daily_sale_report"/>
<element value="dokan_view_top_selling_report"/>
<element value="dokan_view_top_earning_report"/>
<element value="dokan_view_statement_report"/>
<element value="dokan_view_order"/>
<element value="dokan_manage_order"/>
<element value="dokan_manage_order_note"/>
<element value="dokan_manage_refund"/>
<element value="dokan_export_order"/>
<element value="dokan_add_coupon"/>
<element value="dokan_edit_coupon"/>
<element value="dokan_delete_coupon"/>
<element value="dokan_view_reviews"/>
<element value="dokan_manage_reviews"/>
<element value="dokan_manage_withdraw"/>
<element value="dokan_add_product"/>
<element value="dokan_edit_product"/>
<element value="dokan_delete_product"/>
<element value="dokan_view_product"/>
<element value="dokan_duplicate_product"/>
<element value="dokan_import_product"/>
<element value="dokan_export_product"/>
<element value="dokan_view_overview_menu"/>
<element value="dokan_view_product_menu"/>
<element value="dokan_view_order_menu"/>
<element value="dokan_view_coupon_menu"/>
<element value="dokan_view_report_menu"/>
<element value="dokan_view_review_menu"/>
<element value="dokan_view_withdraw_menu"/>
<element value="dokan_view_store_settings_menu"/>
<element value="dokan_view_store_payment_menu"/>
<element value="dokan_view_store_shipping_menu"/>
<element value="dokan_view_store_social_menu"/>
<element value="dokan_view_store_seo_menu"/>
<element value="vendor_staff"/>
</property>
</properties>
</rule>
</ruleset>