-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathphpcs.xml.dist
150 lines (125 loc) · 4.39 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
<?xml version="1.0"?>
<ruleset name="WP Updates Notifier">
<description>PHP_CodeSniffer standard for WP Updates Notifier.</description>
<!--
Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
-->
<arg value="ps" />
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./" />
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8" />
<!-- Check both PHP and JS files. -->
<arg name="extensions" value="php,js" />
<!-- Set severity to 1 to see everything that isn't effectively turned off. -->
<arg name="severity" value="1" />
<!-- Check all files in this directory and the directories below it. -->
<file>.</file>
<!-- Exclude a few directories and autogenerated files. -->
<exclude-pattern>*.min.js</exclude-pattern>
<exclude-pattern>bin/</exclude-pattern>
<exclude-pattern>tests/</exclude-pattern>
<exclude-pattern>vendor/</exclude-pattern>
<!-- Use the WordPress ruleset, with some customizations. -->
<rule ref="WordPress">
<!-- Ignore JS files in the main WordPress standard, since we use ESLint instead. -->
<exclude-pattern>*.js</exclude-pattern>
<!-- Turn off some rules that we don't like. -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
</rule>
<!-- Use the VIP Go ruleset. -->
<rule ref="WordPress-VIP-Go" />
<!-- The version set here matches the minimum version tested in .travis.yml. -->
<config name="minimum_supported_wp_version" value="4.9" />
<rule ref="Squiz.Commenting.FileComment.SpacingAfterComment">
<!--
Downgrade while so many PHP files are empty to start with.
The empty file makes it difficult to comply with this rule
and the trailing newline rule at the same time.
-->
<type>warning</type>
<!--
Once your PHP files have been filled in, you might be able
to start checking for compliance again with an
exclude-pattern like these:
<exclude-pattern>themes(/vip)?/[^/]+/[^/]+\.php$</exclude-pattern>
<exclude-pattern>themes(/vip)?/[^/]+/template-parts/*</exclude-pattern>
-->
</rule>
<rule ref="Generic.Files.OneObjectStructurePerFile">
<!--
Increase severity. If it becomes a problem for this sniff to trigger an
error, then we might want to provide feedback to the WPCS maintainers.
See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/pull/1111.
-->
<type>error</type>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<!--
Verify that the text_domain is set to the desired text-domain.
Multiple valid text domains can be provided as a comma-delimited list.
-->
<property name="text_domain" type="array" value="wp-updates-notifier" />
</properties>
</rule>
<rule ref="WordPress.Files.FileName">
<properties>
<!--
Allow for theme-specific exceptions to the file name rules based
on the theme hierarchy.
-->
<property name="is_theme" value="true" />
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="sc_,ai_,_ai" />
</properties>
</rule>
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<!--
WordPress.com VIP does not propagate wp_cache_set data across datacenters,
largely to avoid attempting to propagate large (>50k) data for batcache.
-->
<property name="forbiddenFunctions" type="array" value="wp_cache_add=>wp_cache_set" />
<!-- This is the newer format, only supported in PHPCS 3.3.0+
<property name="forbiddenFunctions" type="array">
<element key="wp_cache_add" value="wp_cache_set"/>
</property> -->
</properties>
</rule>
<rule ref="Squiz.Commenting.InlineComment.InvalidEndChar">
<!--
TODO: Turn this back on and add end characters to inline comments.
-->
<severity>0</severity>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.Missing">
<!--
TODO: Turn this back on and add comments.
-->
<severity>0</severity>
</rule>
<rule ref="Squiz.Commenting.VariableComment.Missing">
<!--
TODO: Turn this back on and add comments.
-->
<severity>0</severity>
</rule>
<rule ref="WordPress.WP.I18n.MissingTranslatorsComment">
<!--
TODO: Turn this back on and add comments.
-->
<severity>0</severity>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound">
<!--
TODO: Turn this back on and add comments.
-->
<severity>0</severity>
</rule>
</ruleset>