Repository navigation
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
94 lines (85 loc) · 3.5 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
94 lines (85 loc) · 3.5 KB
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
<?xml version="1.0"?>
<ruleset
name="rtcamp/wp-primitives"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd"
>
<description>Sniffs for rtcamp/wp-primitives.</description>
<!-- What to scan: include any root-level PHP files and any folders that contain PHP -->
<file>./inc/</file>
<file>./tests/</file>
<!-- These are excluded from the above paths.-->
<exclude-pattern>**/node_modules/**</exclude-pattern>
<exclude-pattern>**/tests/_output/**</exclude-pattern>
<exclude-pattern>**/vendor/**</exclude-pattern>
<!--
How to scan: include CLI args so you don't need to pass them manually
Usage instructions: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage
-->
<!-- Show sniff codes and progress. -->
<arg value="sp" />
<!-- Report file paths relative to the project root. -->
<arg name="basepath" value="./" />
<!-- Enable colors in report -->
<arg name="colors" />
<!-- Only lint php files by default -->
<arg name="extensions" value="php" />
<!-- Cache the scan results for reuse. -->
<arg name="cache" value="tests/_output/phpcs-cache.json" />
<!-- Enables parallel processing when available for faster results. -->
<arg name="parallel" value="20" />
<!-- Set severity to 1 to see everything that isn't effectively turned off. -->
<arg name="severity" value="1" />
<!--
Tests for PHP version compatibility.
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards#Recomended-additional-rulesets
-->
<config name="testVersion" value="8.2-"/>
<!--
Tests for WordPress version compatibility.
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
-->
<config name="minimum_wp_version" value="6.5"/>
<rule ref="rtCampWP">
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<!-- @todo fix conflict with rtcampWP standard. -->
<exclude name="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces" />
</rule>
<!-- Limit max. consecutive blank lines to 1 instead of 2. -->
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1" />
<property name="spacingBeforeFirst" value="0" />
<property name="spacingAfterLast" value="0" />
</properties>
</rule>
<!-- Relax docblock and other rules for tests. -->
<rule ref="Squiz.Commenting.FunctionComment">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.ClassComment">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.VariableComment">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPressVIPMinimum.Performance.FetchingRemoteData">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Generic.Files.OneObjectStructurePerFile">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
</ruleset>