-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpcs.xml.dist
72 lines (59 loc) · 2.4 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
<?xml version="1.0"?>
<ruleset name="BLOGWHEELS">
<!-- Configure PHP version to test. -->
<config name="testVersion" value="8.0-"/>
<!-- Only check the PHP files. -->
<arg name="extensions" value="php"/>
<!-- Exclude files and folders. -->
<exclude-pattern>*/(.ideas|.notes|node_modules|public|vendor)/*</exclude-pattern>
<!--
########################################################################
Include relevant WordPress rules. We're not using the entire set because
many of them conflict with our preferred coding style.
########################################################################
-->
<rule ref="WordPress.CodeAnalysis"/>
<rule ref="WordPress.DateTime"/>
<rule ref="WordPress.DB"/>
<rule ref="WordPress.PHP"/>
<rule ref="WordPress.Security"/>
<!-- This always recommends `wp_remote_get()` when it shouldn't be used. -->
<rule ref="WordPress.WP">
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"/>
</rule>
<!-- Creates too many false-positives in templating files. -->
<rule ref="WordPress.WP.GlobalVariablesOverride">
<exclude-pattern>*/(patterns|views)/*</exclude-pattern>
</rule>
<!-- Quite a few false-positives for block markup mixed with PHP. -->
<rule ref="Generic.WhiteSpace.ScopeIndent.Incorrect">
<exclude-pattern>*/(patterns)/*</exclude-pattern>
</rule>
<!--
########################################################################
Check PHP compatibility.
########################################################################
-->
<rule ref="PHPCompatibilityWP">
<include-pattern>*\.php$</include-pattern>
</rule>
<!--
########################################################################
Include PSR12 rules.
########################################################################
-->
<rule ref="PSR12">
<!-- Tabs forever. -->
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
<!-- Disabling line length checks for long strings. -->
<exclude name="Generic.Files.LineLength"/>
<!-- This is excluded because it catches empty constructors. -->
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
</rule>
<!-- Enforce tabbed indentation. -->
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<!-- Custom spacing used in templating files. -->
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen">
<exclude-pattern>*/(patterns|views)/*</exclude-pattern>
</rule>
</ruleset>