Repository navigation
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
106 lines (92 loc) · 3.38 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
106 lines (92 loc) · 3.38 KB
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
<?xml version="1.0"?>
<ruleset name="Traktivity">
<description>Coding standards for the Traktivity plugin.</description>
<!-- Scan the whole plugin, minus generated and third-party code. -->
<file>.</file>
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/build/*</exclude-pattern>
<arg name="extensions" value="php"/>
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="parallel" value="8"/>
<arg value="sp"/>
<!-- The minimum WordPress version the plugin supports. -->
<config name="minimum_wp_version" value="7.0"/>
<rule ref="WordPress"/>
<!--
Historic file naming: this plugin ships `core.traktivity.php` and friends,
and the names are baked into the wordpress.org SVN layout. Renaming them
is churn with no upside, so the file name sniff stays off.
-->
<rule ref="WordPress.Files.FileName">
<severity>0</severity>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="traktivity"/>
</property>
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="traktivity"/>
<element value="Traktivity"/>
<element value="TRAKTIVITY"/>
</property>
</properties>
</rule>
<!--
The widget file registers its widget with a named function and then
declares the widget class. Splitting a 400-line widget in two just to
house a one-line registration callback is not worth it.
-->
<rule ref="Universal.Files.SeparateFunctionsFromOO">
<exclude-pattern>/widgets/list-events\.php$</exclude-pattern>
</rule>
<!--
The plugin's whole job is querying events by taxonomy and by meta, so
these two are load-bearing rather than accidental.
-->
<rule ref="WordPress.DB.SlowDBQuery">
<severity>0</severity>
</rule>
<!--
REST permission and validation callbacks have signatures fixed by
WordPress; unused arguments there document the contract.
-->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter">
<exclude-pattern>/rest\.traktivity\.php$</exclude-pattern>
</rule>
<!--
The PHPUnit harness. wp-tests-config.php defines WordPress' own
constants and $table_prefix, which is what a WordPress test config is;
prefixing them would stop the test suite booting.
-->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<exclude-pattern>/tests/php/wp-tests-config\.php$</exclude-pattern>
</rule>
<rule ref="WordPress.WP.GlobalVariablesOverride">
<exclude-pattern>/tests/php/wp-tests-config\.php$</exclude-pattern>
</rule>
<!--
putenv() is how wp-phpunit is told where the test config lives, and it
has to happen before the suite boots.
-->
<rule ref="WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_putenv">
<exclude-pattern>/tests/php/bootstrap\.php$</exclude-pattern>
</rule>
<!--
False positive: this sniff stops recognising a file docblock when the
first statement after it is require_once, which is what a bootstrap
starts with. Swap that line for an assignment and the error goes away.
-->
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>/tests/php/bootstrap\.php$</exclude-pattern>
</rule>
<!-- The plugin declares PHP 7.4 as its minimum in composer.json and the plugin header. -->
<config name="testVersion" value="7.4-"/>
<rule ref="PHPCompatibilityWP"/>
</ruleset>