-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml.dist
89 lines (69 loc) · 2.74 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
<?xml version="1.0"?>
<ruleset name="forsite">
<!-- For help in understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- For help in using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Set a description for this ruleset. -->
<description>A custom set of code standard rules to check for WordPress themes.</description>
<!-- Check all files in this directory and the directories below it. -->
<file>.</file>
<!-- Exclude folders. -->
<!-- See: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders -->
<exclude-pattern>./node_modules/</exclude-pattern>
<exclude-pattern>./vendor/</exclude-pattern>
<!-- Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
-->
<arg value="ps"/>
<!-- Show results with colors -->
<arg name="colors"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 8 files simultanously. -->
<arg name="parallel" value="8"/>
<!-- Only check the PHP files. -->
<arg name="extensions" value="php"/>
<!-- Include the WordPress ruleset, with exclusions. WordPress-Extra Includes WordPress-Core. -->
<!-- See: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<rule ref="WordPress-Extra">
<!-- We have cache busting via dist/mix-manifest.json file. -->
<exclude name="WordPress.WP.EnqueuedResourceParameters.MissingVersion"/>
</rule>
<rule ref="WordPress-Core">
<!-- Allow short open tags. -->
<exclude name="Generic.PHP.DisallowShortOpenTag.EchoFound"/>
</rule>
<!-- Include the WordPress Docs ruleset. -->
<rule ref="WordPress-Docs"/>
<!-- 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>
<!-- Change some errors to warnings. -->
<rule ref="Generic.WhiteSpace.ScopeIndent.IncorrectExact">
<type>warning</type>
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent.Incorrect">
<type>warning</type>
</rule>
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<type>warning</type>
</rule>
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<type>warning</type>
</rule>
<rule ref="WordPress.WP.EnqueuedResourceParameters.NoExplicitVersion">
<type>warning</type>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<type>warning</type>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.MultipleArguments">
<type>warning</type>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<type>warning</type>
</rule>
</ruleset>