|
3 | 3 | <description>Codeat coding standard.</description> |
4 | 4 | <!-- Only check PHP files. --> |
5 | 5 | <arg name="extensions" value="php"/> |
| 6 | + |
6 | 7 | <!-- Treat all files as UTF-8. --> |
7 | 8 | <config name="encoding" value="utf-8"/> |
| 9 | + |
8 | 10 | <!-- Show progress. --> |
9 | | - <arg value="p"/> |
10 | | - <exclude-pattern type="relative">^\.git/*</exclude-pattern> |
| 11 | + <arg value="p"/> |
| 12 | + |
| 13 | + <exclude-pattern type="relative">^\.git/*</exclude-pattern> |
11 | 14 | <exclude-pattern>/vendor/*</exclude-pattern> |
12 | 15 | <exclude-pattern>/node_modules/*</exclude-pattern> |
13 | 16 | <exclude-pattern>freemius</exclude-pattern> |
14 | 17 | <exclude-pattern>*test*</exclude-pattern> |
15 | 18 | <exclude-pattern>index.php</exclude-pattern> |
| 19 | + |
16 | 20 | <!-- Include some specific sniffs --> |
17 | 21 | <rule ref="Generic.CodeAnalysis.EmptyStatement"/> |
18 | 22 | <rule ref="Generic.Commenting.Todo"/> |
|
25 | 29 | <rule ref="Generic.Commenting.DocComment.ContentAfterOpen"/> |
26 | 30 | <rule ref="Generic.Commenting.DocComment.SpacingBeforeShort"/> |
27 | 31 | <rule ref="Generic.Commenting.DocComment.ContentBeforeClose"/> |
| 32 | + |
28 | 33 | <!-- Check for PHP Parse errors. --> |
29 | 34 | <rule ref="Generic.PHP.Syntax"/> |
30 | 35 | <!-- Check for file encoding problems. --> |
31 | 36 | <rule ref="Generic.Files.ByteOrderMark"/> |
32 | | - <rule ref="Generic.Commenting.Todo"/> |
33 | | - <rule ref="Generic.Commenting.Fixme"/> |
34 | | - <rule ref="Zend.Files.ClosingTag"/> |
| 37 | + |
| 38 | + <rule ref="Generic.Commenting.Todo"/> |
| 39 | + <rule ref="Generic.Commenting.Fixme"/> |
| 40 | + <rule ref="Zend.Files.ClosingTag"/> |
| 41 | + |
35 | 42 | <rule ref="Squiz.Commenting"> |
36 | 43 | <exclude name="Squiz.Commenting.FileComment.WrongStyle" /> |
37 | 44 | <exclude name="Squiz.Commenting.FileComment.SpacingAfterOpen" /> |
|
44 | 51 | <exclude name="Squiz.Commenting.FileComment.SpacingAfterComment" /> |
45 | 52 | <exclude name="Squiz.Commenting.BlockComment.NoEmptyLineBefore" /> |
46 | 53 | </rule> |
| 54 | + |
47 | 55 | <rule ref="Squiz.PHP"> |
48 | 56 | <exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" /> |
49 | 57 | <exclude name="Squiz.PHP.GlobalKeyword.NotAllowed" /> |
50 | | - <exclude name="Squiz.PHP.DisallowBooleanStatement.Found" /> |
51 | | - <exclude name="Squiz.PHP.DisallowInlineIf.Found" /> |
52 | | - <exclude name="Squiz.PHP.DisallowComparisonAssignment.AssignedComparison" /> |
53 | | - <exclude name="Squiz.PHP.ForbiddenFunctions.Found" /> |
54 | | - </rule> |
55 | | - <rule ref="Squiz.WhiteSpace.FunctionSpacing" > |
56 | | - <properties> |
57 | | - <property name="spacing" value="1" /> |
58 | | - </properties> |
59 | | - </rule> |
| 58 | + <exclude name="Squiz.PHP.DisallowBooleanStatement.Found" /> |
| 59 | + <exclude name="Squiz.PHP.DisallowInlineIf.Found" /> |
| 60 | + <exclude name="Squiz.PHP.DisallowComparisonAssignment.AssignedComparison" /> |
| 61 | + <exclude name="Squiz.PHP.ForbiddenFunctions.Found" /> |
| 62 | + </rule> |
| 63 | + |
| 64 | + <rule ref="Squiz.WhiteSpace.FunctionSpacing" > |
| 65 | + <properties> |
| 66 | + <property name="spacing" value="1" /> |
| 67 | + </properties> |
| 68 | + </rule> |
| 69 | + |
60 | 70 | <rule ref="Squiz.WhiteSpace"> |
61 | 71 | <exclude name="Squiz.Whitespace.CastSpacing.ContainsWhiteSpace" /> |
62 | 72 | <exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" /> |
63 | 73 | <exclude name="Squiz.WhiteSpace.FunctionSpacing.Before" /> |
64 | 74 | <exclude name="Squiz.WhiteSpace.FunctionSpacing.After" /> |
65 | 75 | <exclude name="Squiz.WhiteSpace.FunctionClosingBraceSpace.SpacingBeforeClose" /> |
66 | | - <exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace" /> |
67 | | - <exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace" /> |
68 | | - <exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" /> |
69 | | - <exclude name="WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd" /> |
| 76 | + <exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace" /> |
| 77 | + <exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace" /> |
| 78 | + <exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" /> |
| 79 | + <exclude name="WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd" /> |
70 | 80 | </rule> |
| 81 | + |
71 | 82 | <rule ref="PEAR.NamingConventions"> |
72 | 83 | <exclude name="PEAR.NamingConventions.ValidClassName.Invalid" /> |
73 | 84 | <exclude name="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore" /> |
74 | 85 | <exclude name="PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps" /> |
75 | | - <exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital" /> |
76 | | - <exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid" /> |
| 86 | + <exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital" /> |
| 87 | + <exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid" /> |
77 | 88 | </rule> |
78 | | - <rule ref="PEAR.NamingConventions"> |
| 89 | + |
| 90 | + <rule ref="PEAR.NamingConventions"> |
79 | 91 | <exclude name="PEAR.NamingConventions.ValidClassName.Invalid" /> |
80 | 92 | <exclude name="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore" /> |
81 | 93 | <exclude name="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore" /> |
82 | 94 | </rule> |
| 95 | + |
83 | 96 | <rule ref="PEAR.Files.IncludingFile"> |
84 | 97 | <exclude name="PEAR.Files.IncludingFile.BracketsNotRequired" /> |
85 | 98 | </rule> |
| 99 | + |
86 | 100 | <!-- https://github.com/wimg/PHPCompatibility/ --> |
87 | 101 | <rule ref="PHPCompatibility"> |
88 | 102 | <exclude name="PHPCompatibility.PHP.EmptyNonVariable.Found" /> |
89 | 103 | <exclude name="PHPCompatibility.PHP.NewClosure.Found" /> |
90 | 104 | </rule> |
91 | | - <rule ref="PHPCompatibilityWP" /> |
92 | | - <!-- Check for cross-version support for PHP 5.6 and higher. --> |
| 105 | + <!-- Check for cross-version support for PHP 5.3 and higher. --> |
93 | 106 | <config name="testVersion" value="5.6"/> |
| 107 | + |
94 | 108 | <rule ref="WordPress"> |
95 | 109 | <exclude name="Generic.Files.LineEndings.InvalidEOLChar" /> |
96 | 110 | <exclude name="Generic.Commenting.DocComment.MissingShort" /> |
|
99 | 113 | <exclude name="PEAR.Functions.FunctionCallSignature.Indent" /> |
100 | 114 | <exclude name="WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys" /> |
101 | 115 | <exclude name="WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys" /> |
102 | | - <exclude name="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound"/> |
| 116 | + <exclude name="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound"/> |
103 | 117 | <exclude name="WordPress.Files.FileName.InvalidClassFileName"/> |
104 | 118 | <exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/> |
105 | 119 | <exclude name="WordPress.PHP.YodaConditions"/> |
|
112 | 126 | <exclude name="WordPress.CSRF.NonceVerification.NoNonceVerification"/> |
113 | 127 | <exclude name="WordPress.Classes.ClassInstantiation.MissingParenthesis" /> |
114 | 128 | </rule> |
115 | | - <rule ref="WordPress.PHP.StrictInArray"/> |
116 | | - <rule ref="WordPress.DB.PreparedSQLPlaceholders"/> |
| 129 | + |
| 130 | + <rule ref="WordPress.PHP.StrictInArray"/> |
| 131 | + <rule ref="WordPress.DB.PreparedSQLPlaceholders"/> |
117 | 132 | <rule ref="WordPress.CodeAnalysis.EmptyStatement"/> |
118 | 133 | <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> |
119 | | - <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> |
120 | | - <rule ref="WordPress.DB.RestrictedFunctions"/> |
| 134 | + <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> |
| 135 | + <rule ref="WordPress.DB.RestrictedFunctions"/> |
121 | 136 | <rule ref="WordPress.DB.RestrictedClasses"/> |
122 | 137 | <rule ref="WordPress.PHP.DevelopmentFunctions"/> |
123 | 138 | <rule ref="WordPress.PHP.DiscouragedPHPFunctions"/> |
124 | 139 | <rule ref="WordPress.WP.AlternativeFunctions"/> |
125 | 140 | <rule ref="WordPress.WP.DiscouragedConstants"/> |
126 | | - <rule ref="WordPress.WP.DiscouragedFunctions"/> |
127 | | - <rule ref="WordPress.WP.EnqueuedResources"/> |
128 | | - <rule ref="WordPress.NamingConventions.PrefixAllGlobals"/> |
| 141 | + <rule ref="WordPress.WP.DiscouragedFunctions"/> |
| 142 | + <rule ref="WordPress.WP.EnqueuedResources"/> |
| 143 | + <rule ref="WordPress.NamingConventions.PrefixAllGlobals"/> |
| 144 | + |
129 | 145 | <rule ref="Wordpress-Docs"> |
130 | 146 | <exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" /> |
131 | 147 | </rule> |
| 148 | + |
132 | 149 | <rule ref="WordPress.WP.DeprecatedClasses"> |
133 | 150 | <properties> |
134 | | - <property name="minimum_supported_version" value="4.9"/> |
| 151 | + <property name="minimum_supported_version" value="4.7"/> |
135 | 152 | </properties> |
136 | 153 | </rule> |
| 154 | + |
137 | 155 | <rule ref="WordPress.WP.DeprecatedFunctions"> |
138 | 156 | <properties> |
139 | | - <property name="minimum_supported_version" value="4.9"/> |
| 157 | + <property name="minimum_supported_version" value="4.7"/> |
140 | 158 | </properties> |
141 | 159 | </rule> |
| 160 | + |
142 | 161 | <rule ref="WordPress.WP.DeprecatedParameters"> |
143 | 162 | <properties> |
144 | | - <property name="minimum_supported_version" value="4.9"/> |
| 163 | + <property name="minimum_supported_version" value="4.7"/> |
145 | 164 | </properties> |
146 | 165 | </rule> |
| 166 | + |
147 | 167 | <!-- Superglobal input not validated or sanitized. --> |
148 | 168 | <rule ref="WordPress.Security.ValidatedSanitizedInput"> |
149 | 169 | <type>warning</type> |
150 | | - </rule> |
| 170 | + </rule> |
| 171 | + |
151 | 172 | <rule ref="Generic.CodeAnalysis.EmptyStatement"> |
152 | 173 | <type>warning</type> |
153 | 174 | </rule> |
|
159 | 180 | <property name="text_domain" type="array" value="glossary-by-codeat,woo-fiscalita-italiana,genesis"/> |
160 | 181 | </properties> |
161 | 182 | </rule> |
| 183 | + |
162 | 184 | </ruleset> |
0 commit comments