-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
62 lines (54 loc) · 2.36 KB
/
phpcs.xml.dist
File metadata and controls
62 lines (54 loc) · 2.36 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
<?xml version="1.0"?>
<ruleset name="WordPress coding standards">
<!-- Rules: Check PHP version compatibility - see
https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>
<!-- For help in understanding this testVersion:
https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="7.4-"/>
<!-- Re-enable PHP 8.0 function checks excluded by PHPCompatibilityWP.
Their WP polyfills only exist in WP 5.9+, but we support WP 5.6+. -->
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.str_containsFound">
<severity>5</severity>
</rule>
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.str_starts_withFound">
<severity>5</severity>
</rule>
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.str_ends_withFound">
<severity>5</severity>
</rule>
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.array_key_firstFound">
<severity>5</severity>
</rule>
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.array_key_lastFound">
<severity>5</severity>
</rule>
<file>.</file><!-- Lint all PHP files by default. -->
<arg name="basepath" value="." /><!-- Show file paths relative to the project root. -->
<arg name="extensions" value="php" />
<arg name="colors" />
<arg value="s" /><!-- Show sniff codes in all reports. -->
<arg name="severity" value="3" /><!-- Match WPVIP requirements. -->
<!-- Includes WordPress-Core, WordPress-Docs and WordPress-Extra rulesets. -->
<rule ref="WordPress" />
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="cloudinary"/>
</property>
</properties>
</rule>
<rule ref="Generic.Commenting.DocComment.LongNotCapital">
<exclude-pattern>php/class-cli.php</exclude-pattern>
<exclude-pattern>php/traits/trait-cli.php</exclude-pattern>
</rule>
<!-- Include WP VIP coding standard checks -->
<rule ref="WordPress-VIP-Go">
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get" />
</rule>
<exclude-pattern>/build/</exclude-pattern>
<exclude-pattern>/js/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
</ruleset>