-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
58 lines (48 loc) · 1.93 KB
/
phpcs.xml.dist
File metadata and controls
58 lines (48 loc) · 1.93 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="WPBridge Coding Standards"
xsi:noNamespaceSchemaLocation="https://schema.phpcodesniffer.com/phpcs.xsd">
<description>WPBridge 插件代码规范</description>
<file>.</file>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/languages/*</exclude-pattern>
<exclude-pattern>*/assets/*</exclude-pattern>
<exclude-pattern>*/backups/*</exclude-pattern>
<exclude-pattern>*/examples/*</exclude-pattern>
<exclude-pattern>*.min.js</exclude-pattern>
<!-- WordPress-Extra 已包含 WordPress-Core,无需重复引用 -->
<rule ref="WordPress-Extra">
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<exclude name="Universal.Operators.DisallowShortTernary"/>
</rule>
<rule ref="WordPress-Docs"/>
<!-- PHP 兼容性检查 -->
<config name="testVersion" value="8.1-"/>
<rule ref="PHPCompatibilityWP">
<include-pattern>*.php$</include-pattern>
</rule>
<!-- 最低 WordPress 版本(用于废弃函数检测) -->
<config name="minimum_wp_version" value="6.4"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="wpbridge"/>
</property>
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="wpbridge"/>
<element value="WPBridge"/>
</property>
</properties>
</rule>
<arg value="ps"/>
<arg name="colors"/>
<arg name="parallel" value="8"/>
<arg value="s"/>
</ruleset>