-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
90 lines (75 loc) · 3.69 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
<?xml version="1.0"?>
<ruleset name="LinchpinPHPCS"
namespace="WordPressCS\WordPress"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>Linchpin WordPress Project PHPCS Sniffs</description>
<!-- Only scan PHP files. -->
<arg name="extensions" value="php"/>
<!-- Trim our base path for easier reading -->
<arg name="basepath" value="."/>
<arg name="colors"/>
<rule ref="Generic.Arrays.DisallowShortArraySyntax.Found">
<severity>0</severity>
</rule>
<config name="testVersion" value="7.4-"/>
<!-- Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
-->
<arg value="ps"/>
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>
<!-- Check all files in this directory and the directories below it. -->
<file>.</file>
<file>class-post-type-spotlight.php</file>
<file>class-post-type-spotlight-block-editor.php</file>
<file>class-pts-featured-posts-widget.php</file>
<!-- Exclude directories and files. -->
<exclude-pattern type="relative">\.github/*</exclude-pattern>
<exclude-pattern type="relative">blocks/build/index.asset.php</exclude-pattern>
<exclude-pattern type="relative">\.deployment/*</exclude-pattern>
<exclude-pattern type="relative">\.husky/*</exclude-pattern>
<exclude-pattern type="relative">vendor/*</exclude-pattern>
<exclude-pattern type="relative">node_modules/*</exclude-pattern>
<exclude-pattern type="relative">tests/*</exclude-pattern>
<exclude-pattern type="relative">gulpfile\.babel\.js</exclude-pattern>
<exclude-pattern type="relative">*.css*</exclude-pattern>
<exclude-pattern type="relative">*.js*</exclude-pattern>
<exclude-pattern type="relative">^build/*</exclude-pattern>
<config name="minimum_supported_wp_version" value="5.7" />
<config name="testVersion" value="7.0-" />
<rule ref="WordPress">
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited" />
<exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed" />
<!-- PSR4 -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<!-- PSR2 -->
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing" />
<exclude name="Squiz.WhiteSpace.OperatorSpacing" />
<exclude name="Generic.Arrays.DisallowLongArraySyntax.Found" />
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
</rule>
<rule ref="WordPress-Extra">
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
<exclude name="PEAR.Functions.FunctionCallSignature.Indent" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeKeyFound" />
</rule>
<!-- Not interested in whitespace issues in JS and CSS files at the moment -->
<rule ref="Squiz.WhiteSpace">
<exclude-pattern>*\.css</exclude-pattern>
<exclude-pattern>*\.js</exclude-pattern>
</rule>
<rule ref="WordPress.WhiteSpace">
<exclude-pattern>*\.css</exclude-pattern>
<exclude-pattern>*\.js</exclude-pattern>
</rule>
<rule ref="Generic.Files.EndFileNewline">
<exclude-pattern>*\.css</exclude-pattern>
<exclude-pattern>*\.js</exclude-pattern>
</rule>
<config name="testVersion" value="5.2-"/>
</ruleset>