-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
116 lines (96 loc) · 4.67 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?xml version="1.0"?>
<ruleset name="Medusa WP Plugin Coding Standards">
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/ -->
<!-- See https://github.com/WordPress/WordPress-Coding-Standards -->
<!-- See https://github.com/WordPress/WordPress-Coding-Standards/wiki -->
<!-- See https://github.com/PHPCompatibility/PHPCompatibility -->
<description>Medusa WP custom set of code standard rules for plugins.</description>
<!--
#############################################################################
COMMAND LINE ARGUMENTS
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset
#############################################################################
-->
<!-- Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
-->
<arg value="ps"/>
<!-- Only check the PHP files. -->
<arg name="extensions" value="php"/>
<arg name="tab-width" value="4"/>
<!-- Check all files in this directory and the directories below it. -->
<file>.</file>
<!-- Exclude folders and files from being checked. -->
<exclude-pattern>*.css</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
<!-- Exclude external dependencies - libraries from being checked. -->
<exclude-pattern>/libraries/*</exclude-pattern>
<!-- Exclude the Composer Vendor directory. -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/oas-clients/*</exclude-pattern>
<!-- Check up to 100 files simultaneously. -->
<arg name="parallel" value="100" />
<!--
#############################################################################
SET UP THE RULESETS
#############################################################################
-->
<rule ref="WordPress">
<!-- WordPress.Security rules -->
<exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotSanitized" />
<exclude name="WordPress.Security.ValidatedSanitizedInput.MissingUnslash" />
<exclude name="WordPress.Security.NonceVerification.Recommended" />
<!-- Other rules -->
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<exclude name="Squiz.Commenting.ClassComment.Missing" />
<exclude name="Squiz.Commenting.FileComment.Missing" />
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag" />
<exclude name="Squiz.Commenting.FileComment.SpacingAfterComment" />
<exclude name="Squiz.Commenting.FileComment.SpacingAfterOpen" />
<exclude name="Squiz.Commenting.FileComment.WrongStyle" />
<exclude name="Squiz.Commenting.FunctionComment.IncorrectTypeHint" />
<exclude name="Squiz.Commenting.FunctionComment.Missing" />
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment" />
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag" />
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop" />
<exclude name="Squiz.Commenting.FunctionComment.ParamNameNoMatch" />
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamType" />
<exclude name="Squiz.Commenting.FunctionComment.WrongStyle" />
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
<exclude name="Squiz.Commenting.VariableComment.Missing" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
</rule>
<!--
#############################################################################
USE THE PHPCompatibility RULESET
#############################################################################
-->
<!-- Check for PHP cross-version compatibility. -->
<config name="testVersion" value="7.4-"/>
<rule ref="PHPCompatibilityWP"/>
<!--
#############################################################################
SNIFF SPECIFIC CONFIGURATION
#############################################################################
-->
<!-- Set the minimum supported WP version. This is used by several sniffs.
The minimum version set here should be in line with the minimum WP version
as set in the "Requires at least" tag in the readme.txt file. -->
<config name="minimum_supported_wp_version" value="5.6"/>
<!-- Verify that the text_domain is set to the desired text-domain.
Multiple valid text domains can be provided as a comma-delimited list. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="medusawp"/>
</properties>
</rule>
<!-- Allow for theme specific exceptions to the file name rules based
on the theme hierarchy. -->
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false"/>
</properties>
</rule>
</ruleset>