forked from understrap/understrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml.dist
101 lines (83 loc) · 2.93 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
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
<?xml version="1.0"?>
<ruleset name="UnderStrap Coding Standards">
<description>Apply WordPress Coding Standards to UnderStrap</description>
<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache" value=".phpcs-cache"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Show colors in console -->
<arg name="colors"/>
<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- Don't show warnings -->
<arg value="n"/>
<!-- Show progress of the run -->
<arg value="p"/>
<!-- Scan these files -->
<file>.</file>
<!-- Directories and third party library exclusions. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/dist/*</exclude-pattern>
<exclude-pattern>/dist-product/*</exclude-pattern>
<!-- Use the WordPress Ruleset -->
<rule ref="WordPress">
<include-pattern>*\.php$</include-pattern>
</rule>
<!--
Verify that the text_domain is set to the desired text-domain.
Multiple valid text domains can be provided as a comma-delimited list.
-->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="understrap"/>
<element value="woocommerce"/>
</property>
</properties>
</rule>
<!--
Allow for theme specific exceptions to the file name rules based
on the theme hierarchy.
-->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="is_theme" value="true"/>
</properties>
</rule>
<!-- Assignments in while conditions are a valid method of looping over iterables. -->
<rule ref="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Exclude incorrectly named files that won't be renamed. -->
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>/inc/class-wp-bootstrap-navwalker\.php</exclude-pattern>
</rule>
<rule ref="WordPress.Security.EscapeOutput">
<!-- Exclude functions which are escaped in inc/extras.php -->
<properties>
<property name="customAutoEscapedFunctions" type="array">
<element value="get_the_title"/>
<element value="get_the_archive_title"/>
<element value="get_the_archive_description"/>
</property>
</properties>
</rule>
<!--
Exclude checking of line endings when reporting errors, but fix them
when running phpcbf.
-->
<rule ref="Generic.Files.LineEndings">
<exclude phpcs-only="true" name="Generic.Files.LineEndings"/>
</rule>
<!-- Use the WPThemeReview Ruleset -->
<rule ref="WPThemeReview" />
<!--
Exclude checking for shortened URLs in Bootstrap's js. files.
Also exlude theme.js which includes bootstrap.js.
-->
<rule ref="WPThemeReview.Privacy.ShortenedURLs.Found">
<exclude-pattern>/src/js/bootstrap4/bootstrap\.*js</exclude-pattern>
<exclude-pattern>/js/theme\.js</exclude-pattern>
</rule>
</ruleset>