-
Notifications
You must be signed in to change notification settings - Fork 112
/
.phpcs.xml.dist
91 lines (72 loc) · 3.62 KB
/
.phpcs.xml.dist
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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Theme Check" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>Coding standards used for checking the code of the Theme Check plugin</description>
<!--
Prevent errors caused by WordPress Coding Standards not supporting PHP 8.0+.
See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
-->
<ini name="error_reporting" value="E_ALL & ~E_DEPRECATED" />
<!-- Exclude the Composer Vendor directory. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<arg value="sp" />
<arg name="basepath" value="." />
<arg name="parallel" value="8" />
<arg name="extensions" value="php" />
<!-- Check the entire plugin. -->
<file>.</file>
<!-- Include the WordPress-Extra standard. -->
<rule ref="WordPress-Extra"/>
<!-- Let's also check that everything is properly documented. -->
<rule ref="WordPress-Docs">
<exclude name="Squiz.Scope.MethodScope.Missing"/>
<exclude name="Squiz.Commenting.FunctionComment.Missing"/>
<exclude name="Squiz.Commenting.FunctionComment.WrongStyle"/>
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="Squiz.Commenting.FileComment.WrongStyle"/>
<exclude name="Squiz.Commenting.ClassComment.SpacingAfter"/>
<exclude name="Squiz.Commenting.ClassComment.Missing"/>
<exclude name="Squiz.Commenting.VariableComment.Missing"/>
<exclude name="Squiz.Commenting.VariableComment.WrongStyle"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="PSR2.Classes.PropertyDeclaration.VarUsed"/>
<exclude name="PSR2.Classes.PropertyDeclaration.ScopeMissing"/>
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure"/>
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/>
</rule>
<!-- Check for PHP cross-version compatibility. -->
<config name="testVersion" value="5.6-"/>
<rule ref="PHPCompatibilityWP"/>
<config name="minimum_supported_wp_version" value="5.1"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="theme-check"/>
</property>
</properties>
<!-- Right now this is more noise, due to the code style -->
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
</rule>
<rule ref="WordPress">
<!-- We don't process data. -->
<exclude name="WordPress.Security.NonceVerification.Missing"/>
<!-- Output is intentionally non-escaped in many places. -->
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped"/>
<!-- We take no real input -->
<exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotSanitized"/>
<!-- This sniff seems irrelevant. -->
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"/>
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict"/>
<!-- Intentionally different names. -->
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/>
<exclude name="PEAR.NamingConventions.ValidClassName.StartWithCapital"/>
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<!-- We're not strict about this. -->
<exclude name="WordPress.PHP.StrictComparisons.LooseComparison"/>
<!-- We don't want Yoda conditions.. -->
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
<!-- We want to allow this. -->
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.Found"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/>
</rule>
</ruleset>