-
Notifications
You must be signed in to change notification settings - Fork 101
/
phpcs.xml.dist
105 lines (88 loc) · 4.4 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
<?xml version="1.0"?>
<ruleset name="VIP-Go-mu-plugins">
<description>Custom ruleset for VIP Go mu-plugins</description>
<!-- For help in understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- For help in using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- What to scan -->
<file>.</file>
<!-- Ignoring Files and Folders:
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders -->
<!-- Submodules - these should have their own PHPCS configurations -->
<exclude-pattern>/advanced-post-cache/*</exclude-pattern>
<exclude-pattern>/cron-control/*</exclude-pattern>
<exclude-pattern>/cron/cron-control/*</exclude-pattern>
<exclude-pattern>/debug-bar-cron/*</exclude-pattern>
<exclude-pattern>/http-concat/*</exclude-pattern>
<exclude-pattern>/jetpack/*</exclude-pattern>
<exclude-pattern>/lightweight-term-count-update/*</exclude-pattern>
<exclude-pattern>/rewrite-rules-inspector/*</exclude-pattern>
<!-- Other directories -->
<exclude-pattern>\.git/*</exclude-pattern>
<exclude-pattern>/__tests__/*</exclude-pattern>
<exclude-pattern>/akismet/*</exclude-pattern>
<exclude-pattern>/bin/*</exclude-pattern>
<exclude-pattern>/debug-bar/*</exclude-pattern>
<exclude-pattern>/drop-ins/*</exclude-pattern>
<exclude-pattern>/jetpack-[\d.]+/</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/query-monitor/*</exclude-pattern>
<exclude-pattern>/search/elasticpress/*</exclude-pattern>
<exclude-pattern>/search/es-wp-query/*</exclude-pattern>
<exclude-pattern>/shared-plugins/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/wordpress-importer/*</exclude-pattern>
<exclude-pattern>/wp-parsely/*</exclude-pattern>
<exclude-pattern>*/build/*\.asset\.php</exclude-pattern>
<exclude-pattern>/vip-integrations/*vip-block-data-api-*/*vendor*</exclude-pattern>
<!-- How to scan -->
<!-- Strip the file paths down to the relevant bit -->
<arg name="basepath" value="."/>
<!-- Enables parallel processing when available for faster results. -->
<arg name="parallel" value="8"/>
<!-- Limit to PHP files -->
<arg name="extensions" value="php"/>
<arg value="s"/>
<!-- 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-"/>
<!-- Rules: WordPress Coding Standards - see
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- WordPress-Extra includes WordPress-Core -->
<rule ref="WordPress-Extra"/>
<!-- For help in understanding these custom sniff properties:
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="5.8"/>
<!-- Rules: Check VIP Coding Standards - see
https://github.com/Automattic/VIP-Coding-Standards/ -->
<rule ref="WordPress-VIP-Go">
<!-- These disallow anonymous functions as action callbacks -->
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
<!-- Allow short array syntax -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
<!-- Do not enforce 'class-' prefix -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<!-- Allow short ternaries -->
<exclude name="Universal.Operators.DisallowShortTernary.Found" />
<!-- Generates too many false positives -->
<exclude name="WordPress.WP.CapitalPDangit.Misspelled" />
<!-- We use trigger_error extensively -->
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_trigger_error" />
<exclude name="Universal.NamingConventions.NoReservedKeywordParameterNames" />
</rule>
<rule ref="Universal.Files.SeparateFunctionsFromOO.Mixed">
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.WP.Capabilities">
<properties>
<property name="custom_capabilities" type="array">
<element value="view_query_monitor" />
<element value="vip_support" />
</property>
</properties>
</rule>
</ruleset>