-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
127 lines (99 loc) · 4.14 KB
/
phpcs.xml
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
<?xml version="1.0"?>
<ruleset name="Bleech-WordPress-CS">
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki -->
<!-- See https://github.com/wimg/PHPCompatibility -->
<description>Ruleset for Bleech WordPress Plugins.</description>
<!-- Check all files in this directory and the directories below it. -->
<file>./</file>
<exclude-pattern>*/build/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/svn/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>includes/core/libraries/*</exclude-pattern>
<exclude-pattern>components/emails/*</exclude-pattern>
<!-- Strip the file paths down to the relevant bit -->
<arg name="basepath" value="./" />
<!-- Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
v flag: Print verbose output.
n flag: Do not print warnings.
sp
-->
<arg value="sp"/>
<!-- Enable colors in report. -->
<arg name="colors"/>
<!-- Check up to 8 files simultanously. -->
<arg name="parallel" value="8"/>
<!-- Only check the PHP files. -->
<arg name="extensions" value="php"/>
<!-- Check for PHP cross-version compatibility. -->
<config name="testVersion" value="7.0-"/>
<rule ref="PHPCompatibilityWP"/>
<!-- Check for WordPress cross-version compatibility. -->
<config name="minimum_supported_wp_version" value="5.0"/>
<!-- Let's check that everything is properly documented. -->
<rule ref="WordPress-Docs"/>
<!-- Include the WordPress-Extra standard. -->
<rule ref="WordPress-Extra" />
<!-- Allow theme filename exceptions e.g. archive-{post_type}.php -->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="is_theme" value="true"/>
</properties>
</rule>
<!-- Allow short Ternary -->
<rule ref="WordPress.PHP.DisallowShortTernary.Found">
<exclude name="WordPress.PHP.DisallowShortTernary.Found" />
</rule>
<!-- Allow short array syntax -->
<rule ref="Generic.Arrays.DisallowShortArraySyntax.Found">
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
</rule>
<!-- Disallow long array syntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<!-- Don't align equal signs -->
<rule ref="Generic.Formatting.MultipleStatementAlignment.NotSameWarning">
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
</rule>
<!-- Don't aligned array double arrow -->
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
</rule>
<!-- Class and file comments aren't neccessary -->
<rule ref="Squiz.Commenting">
<exclude name="Squiz.Commenting.FileComment.Missing" />
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag" />
<exclude name="Squiz.Commenting.ClassComment.Missing" />
</rule>
<!-- Useful code analysis sniffs. -->
<rule ref="WordPress.CodeAnalysis"/>
<!-- Date Time sniffs. -->
<rule ref="WordPress.DateTime"/>
<!-- Database sniffs. -->
<rule ref="WordPress.DB"/>
<!-- Security sniffs. -->
<rule ref="WordPress.Security"/>
<!-- I18n sniffs. -->
<rule ref="WordPress.Utils.I18nTextDomainFixer"/>
<!-- <rule ref="Generic.Commenting.DocComment.NonParamGroup">
<exclude name="Generic.Commenting.DocComment.NonParamGroup" />
</rule> -->
<rule ref="PEAR.Functions.FunctionCallSignature">
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<exclude-pattern>/includes/core/settings/field-*/</exclude-pattern>
<exclude-pattern>/components/</exclude-pattern>
<properties>
<property name="prefixes" type="array">
<element value="vrts"/>
</property>
</properties>
</rule>
</ruleset>