-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
115 lines (93 loc) · 4.41 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
<?xml version="1.0"?>
<ruleset name="WordPress Theme Coding Standards"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>A custom set of rules to check for a WPized WordPress project</description>
<!-- General PHPCS config. -->
<file>.</file>
<arg value="sp"/>
<arg name="extensions" value="php"/>
<arg name="basepath" value="."/>
<arg name="parallel" value="8"/>
<!-- Exclude patterns. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<!-- WordPress Rules -->
<!-- See https://github.com/WordPress/WordPress-Coding-Standards -->
<rule ref="WordPress">
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found"/>
<exclude name="PHPCompatibility.FunctionDeclarations"/>
<exclude name="PHPCompatibility.Syntax"/>
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
<exclude name="Squiz.Commenting.InlineComment"/>
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Squiz.Commenting.FileComment"/>
<exclude name="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
<exclude name="Squiz.PHP.CommentedOutCode"/>
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/>
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_query"/>
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_tax_query"/>
<exclude name="WordPress.Files.FileName"/>
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound"/>
<exclude name="WordPress.PHP.YodaConditions"/>
<exclude name="WordPress.PHP.StrictInArray"/>
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped"/>
<exclude name="WordPress.Security.NonceVerification.Recommended"/>
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited"/>
</rule>
<!-- WordPress I18n config. -->
<config name="minimum_supported_wp_version" value="6.0"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="construye-mundo"/>
</property>
</properties>
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
</rule>
<!-- WordPress naming config. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="cm_"/>
<element value="iv_"/>
</property>
</properties>
</rule>
<!-- WordPress arrays config. -->
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<property name="alignMultilineItems" value="!=100"/>
<property name="exact" value="false" phpcs-only="true"/>
</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="is_theme" value="true"/>
</properties>
</rule>
<!-- PHP Compatibility -->
<!-- See https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<config name="testVersion" value="7.4-"/>
<rule ref="PHPCompatibility">
<!-- Exclude PHP constants back-filled by PHPCS. -->
<exclude name="PHPCompatibility.Constants.NewConstants.t_finallyFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_yieldFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_ellipsisFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_powFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_pow_equalFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_spaceshipFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_coalesceFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_coalesce_equalFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_yield_fromFound"/>
</rule>
<!-- Let's also check that everything is properly documented. -->
<rule ref="WordPress-Docs"/>
<!-- Add in some extra rules from other standards. -->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
</ruleset>