forked from nexcess/limit-orders
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpcs.xml.dist
112 lines (87 loc) · 3.67 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
<?xml version="1.0"?>
<ruleset name="Limit Orders for WooCommerce">
<description>Rules for Limit Orders for WooCommerce.</description>
<!-- Show progresss & use colors. -->
<arg value="ps" />
<arg name="colors" />
<!-- Strip the file paths down to the relevant bit and only apply to .php files. -->
<arg name="basepath" value="./" />
<arg name="extensions" value="php" />
<!-- Enables parallel processing when available for faster results. -->
<arg name="parallel" value="8" />
<!-- What to scan -->
<file>src</file> <!-- The rest of the plugin files. -->
<file>limit-orders.php</file> <!-- Main plugin file.-->
<file>./tests</file> <!-- Test files. -->
<!-- Ensure compatibility with PHP 7.2 and newer. -->
<config name="testVersion" value="7.2-" />
<rule ref="PHPCompatibilityWP" />
<!-- Requires WordPress 5.8 or newer. -->
<config name="minimum_supported_wp_version" value="5.8" />
<!-- Configure the plugin text domain. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="limit-orders"/>
</properties>
</rule>
<!-- No PHP syntax errors. -->
<rule ref="Generic.PHP.Syntax"/>
<!-- PHPCompatibilityWP -->
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP" />
<!-- Use strict WordPress coding standards -->
<rule ref="WordPress-Extra">
<!-- Embrace PSR-4 autoloading. -->
<exclude name="WordPress.Files.FileName" />
<!-- Short array syntax is absolutely permitted and, in fact, preferred. -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
<!-- Prevent closures from looking terrible. -->
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
<!-- Short ternaries are fine. -->
<exclude name="WordPress.PHP.DisallowShortTernary.Found" />
</rule>
<!-- Spacing before/after control structures. -->
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing" />
<!-- Tests -->
<!-- Tests can use whichever naming conventions we see fit. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!-- Tests can use whatever methods we see fit. -->
<rule ref="WordPress.PHP.DevelopmentFunctions">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DiscouragedPHPFunctions">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!-- Tests aren't required to escape output. -->
<rule ref="WordPress.Security.EscapeOutput">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!-- Tests don't need to worry about nonces. -->
<rule ref="WordPress.Security.NonceVerification">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!-- Short ternaries are fine. -->
<rule ref="WordPress.PHP.DisallowShortTernary.Found">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!-- Tests don't need to define a text domain. -->
<rule ref="WordPress.WP.I18n.MissingArgDomain">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
</ruleset>