Repository navigation
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
128 lines (114 loc) · 4.05 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
128 lines (114 loc) · 4.05 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version="1.0"?>
<ruleset name="Scanfully">
<description>Coding standards for the Scanfully plugin.</description>
<file>src</file>
<file>tests</file>
<file>scanfully.php</file>
<file>uninstall.php</file>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/tests/Fixtures/*</exclude-pattern>
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="parallel" value="8"/>
<arg name="extensions" value="php"/>
<arg value="sp"/>
<!--
Default severity: errors only. Run `composer lint:strict` to include
warnings.
-->
<arg name="warning-severity" value="0"/>
<arg name="error-severity" value="1"/>
<config name="testVersion" value="7.4-"/>
<config name="minimum_supported_wp_version" value="6.0"/>
<!-- WordPress Coding Standards (3.x). -->
<rule ref="WordPress">
<!-- Modern PHP: short arrays are fine. -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<!-- PSR-4 file naming (PascalCase class per file), not WP file naming (class-*.php). -->
<exclude name="WordPress.Files.FileName"/>
<!-- Yoda conditions are not required; normal order is more readable. -->
<exclude name="WordPress.PHP.YodaConditions"/>
<!--
Empty catch blocks are allowed when they explain why; that is
enforced by Squiz.Commenting.EmptyCatchComment.
-->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="scanfully"/>
</property>
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="scanfully"/>
<element value="Scanfully"/>
</property>
</properties>
</rule>
<!-- PHP cross-version compatibility. -->
<rule ref="PHPCompatibilityWP"/>
<!--
Method and function names follow WordPress standards: lowercase with
underscores. PHPUnit's API (setUp/tearDown) is the one exception, so the
method-name sniff is relaxed for test files only.
-->
<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!--
Test files do not require WPCS-style docblocks. Test method names and
PHPUnit annotations carry the intent. Fixture classes may share a file.
-->
<rule ref="Squiz.Commenting.FunctionComment.Missing">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.MissingParamTag">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.ClassComment.Missing">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FileComment.Missing">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Generic.Commenting.DocComment.MissingShort">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Classes.ClassFileName.NoMatch">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.VariableComment.Missing">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!--
Tests legitimately set up WordPress globals to drive a unit under test.
The override sniff is production-oriented.
-->
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!--
Test doubles throw exceptions (for example from a stubbed wp_die()) whose
messages are never rendered as HTML.
-->
<rule ref="WordPress.Security.EscapeOutput.ExceptionNotEscaped">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<!--
Test bootstraps define WordPress constants (ABSPATH) and stub
third-party classes under their own namespaces, so the prefix rule
does not apply there.
-->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
</ruleset>