-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpcs.xml
101 lines (79 loc) · 3.21 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
91
92
93
94
95
96
97
98
99
100
101
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Planet4 Child Theme Switzerland" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
<description>Custom ruleset based on WordPress coding standards.</description>
<file>.</file>
<!-- Exclude the Composer Vendor directory. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- Exclude the Node Modules directory. -->
<exclude-pattern>/node_modules/*</exclude-pattern>
<!-- Exclude minified Javascript files. -->
<exclude-pattern>*.min.js</exclude-pattern>
<!-- Exclude vendor Javascript files -->
<exclude-pattern>/js/vendor/*</exclude-pattern>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="."/>
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>
<!--
#############################################################################
SET UP THE RULESETS
#############################################################################
-->
<!-- Include the WordPress-Extra standard. -->
<rule ref="WordPress-Extra">
<!--
Excluded rules
-->
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/>
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed"/>
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>
</rule>
<!-- Let's also check that everything is properly documented. -->
<rule ref="WordPress-Docs"/>
<!--
#############################################################################
SNIFF SPECIFIC CONFIGURATION
#############################################################################
-->
<!--
For information on additional custom properties available, check out
the wiki:
https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
-->
<config name="minimum_wp_version" value="6.4"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="planet4-child-theme-switzerland"/>
</property>
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="gpch"/>
</property>
</properties>
</rule>
<!--
#############################################################################
SELECTIVE EXCLUSIONS
Exclude specific files for specific sniffs and/or exclude sub-groups in sniffs.
#############################################################################
-->
<!--
Sometimes, you may want to exclude a certain directory, like your tests,
for select sniffs.
For more information on ruleset configuration options, check out the PHPCS wiki:
https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset
-->
<rule ref="WordPress.WP.GlobalVariablesOverride">
<exclude-pattern>/path/to/Tests/*Test\.php</exclude-pattern>
</rule>
<rule ref="WordPress.Files.FileName">
<exclude-pattern>/path/to/Tests/*Test\.php</exclude-pattern>
</rule>
</ruleset>