-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.phpcs.xml.dist
More file actions
112 lines (102 loc) · 3.94 KB
/
.phpcs.xml.dist
File metadata and controls
112 lines (102 loc) · 3.94 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?xml version="1.0"?>
<ruleset
name="Plugin Skeleton D Coding Standards"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd"
>
<description>Sniffs for Plugin Skeleton D</description>
<!-- What to scan: include any root-level PHP files and any folders that contain PHP -->
<file>./framework/</file>
<file>./inc/</file>
<file>./src/blocks/</file>
<file>./templates/</file>
<file>./tests/php/</file>
<file>./plugin-skeleton-d.php</file>
<file>./uninstall.php</file>
<!-- These are excluded from the above paths.-->
<exclude-pattern>**/build/**</exclude-pattern>
<exclude-pattern>**/node_modules/**</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 and progress -->
<arg value="sp" />
<!-- Strip the file paths down to the relevant bit -->
<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" />
<!-- Ruleset Config: set these to match your project constraints. -->
<!--
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.9" />
<!-- Included rulesets -->
<!--
Enterprise best practices for WordPress.
https://github.com/rtCamp/coding-standards-d
-->
<rule ref="rtCamp" />
<!-- Exclude unnecessary and noisy rules from tests -->
<rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="Generic.PHP.NoSilencedErrors">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DiscouragedPHPFunctions">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.NoSilencedErrors">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="WordPress.WP.EnqueuedResources.NonEnqueuedScript">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<rule ref="WordPressVIPMinimum.Files.IncludingFile.UsingVariable">
<exclude-pattern>**/tests/**</exclude-pattern>
</rule>
<!--
Plugin-specific customizations.
https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
-->
<!-- Allowed plugin prefixes -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<!-- Exclude PHP files in src/blocks from this sniff -->
<exclude-pattern>src/blocks/**</exclude-pattern>
<exclude-pattern>**/tests/**</exclude-pattern>
<properties>
<property name="prefixes" type="array">
<element value="PLUGIN_SKELETON_D" /><!-- Constant -->
<element value="rtCamp\Plugin_Skeleton_D" /><!-- Class -->
<element value="plugin_skeleton_d_" /><!-- Function/variable -->
</property>
</properties>
</rule>
<!-- PHP Text translation domain. Javascript domain is set in the eslint config. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="plugin-skeleton-d" />
</property>
</properties>
</rule>
</ruleset>