-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist.example
More file actions
103 lines (91 loc) · 3.65 KB
/
Copy pathphpcs.xml.dist.example
File metadata and controls
103 lines (91 loc) · 3.65 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
<?xml version="1.0"?>
<ruleset
name="My Project 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 My Project — extends the shared rtCamp WordPress standard.</description>
<!-- ==========================================================
What to scan. List the project's PHP entry points and folders.
========================================================== -->
<file>./includes/</file>
<file>./src/</file>
<file>./tests/</file>
<file>./my-plugin.php</file>
<!-- Excluded from the paths above. -->
<exclude-pattern>*/build/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<!-- ==========================================================
How to scan (so these need not be passed on the CLI).
========================================================== -->
<!-- Show sniff codes and progress. -->
<arg value="sp" />
<!-- Strip file paths down to the relevant bit. -->
<arg name="basepath" value="./" />
<!-- Colour the report. -->
<arg name="colors" />
<!-- Only lint PHP files. -->
<arg name="extensions" value="php" />
<!-- Cache results for faster re-runs. -->
<arg name="cache" value=".phpcs.cache" />
<!-- Run files in parallel. -->
<arg name="parallel" value="20" />
<!-- ==========================================================
Project constraints — set these to match your project.
========================================================== -->
<!-- Lowest PHP version you support (used by PHPCompatibilityWP). -->
<config name="testVersion" value="8.2-" />
<!-- Lowest WordPress version you support. -->
<config name="minimum_wp_version" value="6.5" />
<!-- ==========================================================
The shared rtCamp WordPress standard.
rtCampWP — full strict (recommended for new / public projects).
rtCampWP-Basic — WPCS + VIP + Docs + PHP compatibility, no strict typing
(recommended when adopting on an existing codebase).
========================================================== -->
<rule ref="rtCampWP" />
<!-- ==========================================================
Project-specific configuration.
========================================================== -->
<!-- Global prefixes for functions, classes and constants. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="My_Project" />
<element value="my_project" />
<element value="MY_PROJECT" />
</property>
</properties>
</rule>
<!-- Text domain(s) used by this project. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="my-project" />
</property>
</properties>
</rule>
<!-- File naming. Pick the line that matches your project:
- Themes: enforce the theme file hierarchy. -->
<!--
<rule ref="WordPress.Files.FileName">
<properties>
<property name="is_theme" value="true" />
</properties>
</rule>
-->
<!-- - PSR-4 autoloaded plugins (PascalCase filenames): disable the rule. -->
<!--
<rule ref="WordPress.Files.FileName">
<severity>0</severity>
</rule>
-->
<!-- Relax noisy rules in test files (optional). -->
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
</ruleset>