-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathphpcs.xml.dist
80 lines (65 loc) · 2.42 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
<?xml version="1.0"?>
<ruleset name="BlockTheme Coding Standards">
<description>Apply WordPress Coding Standards to BlockTheme</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"/>
<!-- Only check the PHP, CSS and SCSS files. JS files are checked separately with ESLint. -->
<arg name="extensions" value="php,css,scss/css"/>
<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- Scan these files -->
<file>.</file>
<!-- Directories and third party library exclusions. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/languages/*</exclude-pattern>
<exclude-pattern>/inc/deprecated.php</exclude-pattern>
<exclude-pattern>/fonts/*</exclude-pattern>
<exclude-pattern>/dist/*</exclude-pattern>
<exclude-pattern>/patterns/*\.php$</exclude-pattern>
<exclude-pattern>/css/*</exclude-pattern>
<exclude-pattern>/blocks/*</exclude-pattern>
<exclude-pattern>/js/*</exclude-pattern>
<exclude-pattern>*.min.(js|css)</exclude-pattern>
<exclude-pattern>*.asset.php</exclude-pattern>
<exclude-pattern>/\.*</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="block-theme"/>
</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 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>
</ruleset>