forked from Yoast/wordpress-seo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml.dist
71 lines (58 loc) · 2.85 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
<?xml version="1.0"?>
<ruleset name="Yoast SEO">
<description>Yoast SEO rules for PHP_CodeSniffer</description>
<file>.</file>
<exclude-pattern>tests/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>vendor_prefixed/*</exclude-pattern>
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>deprecated/*</exclude-pattern>
<exclude-pattern>languages/*</exclude-pattern>
<exclude-pattern>artifact/*</exclude-pattern>
<exclude-pattern>.wordpress-svn/*</exclude-pattern>
<exclude-pattern>config/php-scoper/*</exclude-pattern>
<exclude-pattern>src/generated/*</exclude-pattern>
<arg name="extensions" value="php"/>
<arg value="sp"/>
<rule ref="Yoast">
<exclude name="WordPress.WP.PreparedSQL.NotPrepared"/><!-- TODO audit raw queries -->
<exclude name="WordPress.Functions.DontExtract" /><!-- TODO audit usage & replace -->
<exclude name="Squiz.Commenting.FunctionCommentThrowTag.WrongNumber" /><!-- TODO Remove this once we're on 0.5. See https://github.com/squizlabs/PHP_CodeSniffer/issues/650 for more info. -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
</rule>
<!-- Demand short arrays. -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Exclude migrations folder from filename checks, as we do not have control over this format -->
<rule ref="WordPress.Files.FileName.UnderscoresNotAllowed">
<exclude-pattern>migrations/*</exclude-pattern>
</rule>
<rule ref="Generic.Files.LowercasedFilename.NotFound">
<exclude-pattern>migrations/*</exclude-pattern>
</rule>
<!-- /Exclude migrations folder -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" value="wordpress-seo"/>
</properties>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName">
<properties>
<property name="customVariablesWhitelist" type="array" value="pageUrl,responseCode,siteEntry,siteUrl,countPerTypes,urlCrawlErrorSample,buyUrl,infoUrl" />
</properties>
</rule>
<!-- TEMPORARY exclusion! This has to do with a bug in WPCS 0.10.0. The bug has been fixed in WPCS 0.11.0. -->
<rule ref="WordPress.WP.I18n.UnorderedPlaceholders">
<exclude-pattern>inc/class-wpseo-replace-vars.php</exclude-pattern>
</rule>
<!-- TEMPORARY exclusion! Because we're not on 0.5 yet -->
<rule ref="WordPress.VIP.RestrictedFunctions">
<exclude-pattern>inc/class-wpseo-image-utils.php</exclude-pattern>
</rule>
<!--
#############################################################################
SNIFF FOR PHP CROSS-VERSION COMPATIBILITY
#############################################################################
-->
<config name="testVersion" value="5.6-"/>
<rule ref="PHPCompatibilityWP"/>
</ruleset>