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