-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpcs.xml.dist
104 lines (98 loc) · 3.89 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
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards based custom ruleset for your code">
<description>Generally-applicable sniffs for WordPress code.</description>
<!-- What to scan -->
<file>./index.php</file>
<file>./src</file>
<file>./test</file>
<file>./library</file>
<exclude-pattern>./test/phpunit/wp-config.php</exclude-pattern>
<exclude-pattern>./test/phpunit/bootstrap.php</exclude-pattern>
<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<arg value="sp" /><!-- Show sniff and progress -->
<arg name="basepath" value="./" /><!-- Strip the file paths down to the relevant bit -->
<arg name="colors" />
<arg name="extensions" value="php" />
<arg name="parallel" value="8" /><!-- Enables parallel processing when available for faster
results. -->
<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!--
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="4.6" />
<rule ref="Generic.PHP.DisallowShortOpenTag">
<severity>0</severity>
</rule>
<rule ref="WordPress" />
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<exclude-pattern>./library/</exclude-pattern>
<exclude-pattern>./src/views/*</exclude-pattern>
<exclude-pattern>./src/**/views/*</exclude-pattern>
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple
prefixes with a comma. -->
<property name="prefixes" type="array">
<element value="wordpress_plugin_name" />
</property>
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<exclude-pattern>./library/</exclude-pattern>
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="wordpress-plugin-name-textdomain" />
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true" />
</properties>
</rule>
<rule ref="Squiz.PHP.EmbeddedPhp.ShortOpenEchoNoSemicolon">
<exclude-pattern>./src/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>./library/*</exclude-pattern>
</rule>
<!-- Do not require docblocks for unit tests -->
<rule ref="Squiz.Commenting.FunctionComment.Missing">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.ClassComment.Missing">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.ClassComment.SpacingAfter">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.MissingParamTag">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<rule ref="Generic.Commenting.DocComment.Empty">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<rule ref="Generic.Commenting.DocComment.MissingShort">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.VariableComment.Missing">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionCommentThrowTag.Missing">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<!-- Ignore filename error -->
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<!-- Exclude php tests from file and class name sniffs (for Core parity). -->
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
<rule ref="PEAR.NamingConventions.ValidClassName.Invalid">
<exclude-pattern>./test/*</exclude-pattern>
</rule>
</ruleset>