-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
88 lines (77 loc) · 2.89 KB
/
phpcs.xml
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
<?xml version="1.0"?>
<ruleset name="Dow Jones">
<description>PHP_CodeSniffer standard for Dow Jones WordPress Coding Standards.</description>
<!--
Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
n flag: Do not print warnings.
-->
<arg value="psn" />
<!--
Only check the PHP files.
Check all files in this directory and the directories below it.
Exclude a few directories and autogenerated files.
-->
<arg name="extensions" value="php" />
<file>.</file>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>inc/cli.php</exclude-pattern>
<exclude-pattern>tests/</exclude-pattern>
<exclude-pattern>vendor/</exclude-pattern>
<rule ref="WordPress" />
<!-- 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="meta-fields" />
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="dow_jones,dj" />
</properties>
<!-- In practice, partials should be loaded outside of the global namespace with get_template_part(). -->
<exclude-pattern>vendor/</exclude-pattern>
</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>
</ruleset>