-
Notifications
You must be signed in to change notification settings - Fork 6
/
phpcs.xml.dist
68 lines (58 loc) · 2.55 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
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Plugins">
<description>Generally-applicable sniffs for WordPress plugins</description>
<config name="text_domain" value="enable-mastodon-apps" />
<rule ref="WordPress" />
<rule ref="WordPress-Core">
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict" />
<exclude name="Squiz.Commenting.FileComment.Missing" />
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag" />
<exclude name="Squiz.Commenting.VariableComment.Missing" />
<exclude name="Squiz.Commenting.FunctionComment.Missing" />
</rule>
<rule ref="WordPress-Docs" />
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Security">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPress">
<exclude-pattern>bin/extract-hooks.php</exclude-pattern>
</rule>
<rule ref="WordPress.Security.EscapeOutput">
<properties>
<!-- Some common functions that might technically require output escaping, but rarely cause anything but false positives -->
<property name="customAutoEscapedFunctions" type="array">
<element key="__" value="__" />
<element key="_e" value="_e" />
<element key="_x" value="_x" />
<element key="wp_create_nonce" value="wp_create_nonce" />
<element key="plugin_dir_url" value="plugin_dir_url" />
<element key="plugins_url" value="plugins_url" />
<element key="admin_url" value="admin_url" />
<element key="sanitize_text_field" value="sanitize_text_field" />
<element key="sanitize_textarea_field" value="sanitize_textarea_field" />
<element key="get_locale" value="get_locale" />
<element key="get_bloginfo" value="get_bloginfo" /> <!-- only safe if 'display' filter is used -->
</property>
</properties>
<type>warning</type>
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
<exclude-pattern>*/widgets/*</exclude-pattern>
<exclude-pattern>*/templates/email/*.text.php</exclude-pattern>
</rule>
<rule ref="WordPress.Security.EscapeOutput.UnsafePrintingFunction">
<type>warning</type>
</rule>
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>includes/oauth2/*.php</exclude-pattern>
</rule>
<!-- Check all PHP files in directory tree by default. -->
<arg name="extensions" value="php"/>
<file>.</file>
<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>
<exclude-pattern>*/vendor/*</exclude-pattern>
</ruleset>