forked from salcode/bootstrap4-genesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.phpcs.xml.dist
59 lines (48 loc) · 2.01 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
<?xml version="1.0"?>
<ruleset name="Bootstrap4 Genesis">
<description>The code standard for the Bootstrap4 Genesis Theme.</description>
<!-- Exclude the Composer Vendor directory. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- Exclude the Node Modules directory. -->
<exclude-pattern>/node_modules/*</exclude-pattern>
<!-- Exclude all Javascript files. -->
<exclude-pattern>*.js</exclude-pattern>
<!-- Exclude minified CSS file. -->
<exclude-pattern>style.css</exclude-pattern>
<!-- Include the WordPress-Extra standard. -->
<rule ref="WordPress-Extra">
<!--
We may want a middle ground though. The best way to do this is add the
entire ruleset, then rule by rule, remove ones that don't suit a project.
We can do this by running `phpcs` with the '-s' flag, which allows us to
see the names of the sniffs reporting errors.
Once we know the sniff names, we can opt to exclude sniffs which don't
suit our project like so.
The below two examples just show how you can exclude rules.
They are not intended as advice about which sniffs to exclude.
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing"/>
<exclude name="WordPress.Security.EscapeOutput"/>
-->
</rule>
<!-- Add in some extra rules from other standards. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Squiz.Commenting.FunctionComment.SpacingAfter"/>
<!-- Only enforce aligning assignment operators when difference is 2 or less. -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="2" />
</properties>
</rule>
<!-- Do not follow WordPress class name naming requirements -->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false" />
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="bs4g, bootstrap4_genesis"/>
</properties>
</rule>
</ruleset>