|
1 | 1 | <?xml version="1.0"?> |
2 | 2 | <ruleset name="Codeat"> |
3 | 3 | <description>Codeat coding standard.</description> |
| 4 | + <!-- Only check PHP files. --> |
| 5 | + <arg name="extensions" value="php"/> |
4 | 6 |
|
| 7 | + <!-- Treat all files as UTF-8. --> |
| 8 | + <config name="encoding" value="utf-8"/> |
| 9 | + |
| 10 | + <!-- Show progress. --> |
| 11 | + <arg value="p"/> |
| 12 | + |
| 13 | + <exclude-pattern type="relative">^\.git/*</exclude-pattern> |
5 | 14 | <exclude-pattern>/vendor/*</exclude-pattern> |
6 | 15 | <exclude-pattern>/node_modules/*</exclude-pattern> |
7 | 16 | <exclude-pattern>freemius</exclude-pattern> |
8 | | - <exclude-pattern>/lib/</exclude-pattern> |
9 | 17 | <exclude-pattern>*test*</exclude-pattern> |
10 | 18 | <exclude-pattern>index.php</exclude-pattern> |
11 | | - <exclude-pattern>CMB2</exclude-pattern> |
12 | 19 |
|
13 | 20 | <!-- Include some specific sniffs --> |
14 | 21 | <rule ref="Generic.CodeAnalysis.EmptyStatement"/> |
|
23 | 30 | <rule ref="Generic.Commenting.DocComment.SpacingBeforeShort"/> |
24 | 31 | <rule ref="Generic.Commenting.DocComment.ContentBeforeClose"/> |
25 | 32 |
|
| 33 | + <!-- Check for PHP Parse errors. --> |
| 34 | + <rule ref="Generic.PHP.Syntax"/> |
| 35 | + <!-- Check for file encoding problems. --> |
| 36 | + <rule ref="Generic.Files.ByteOrderMark"/> |
| 37 | + |
26 | 38 | <rule ref="Squiz.Commenting"> |
27 | 39 | <exclude name="Squiz.Commenting.FileComment.WrongStyle" /> |
28 | 40 | <exclude name="Squiz.Commenting.FileComment.SpacingAfterOpen" /> |
|
102 | 114 | <exclude name="WordPress.XSS.EscapeOutput" /> |
103 | 115 | <exclude name="WordPress.PHP.YodaConditions"/> |
104 | 116 | <exclude name="WordPress.Arrays.ArrayIndentation.ItemNotAligned" /> |
105 | | - <exclude name="WordPress.PHP.DevelopmentFunctions.error_log_error_log" /> |
106 | 117 | <exclude name="WordPress.Variables.GlobalVariables"/> |
107 | 118 | <exclude name="WordPress.WP.I18n.NonSingularStringLiteralDomain"/> |
108 | 119 | <exclude name="WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter" /> |
|
113 | 124 | <exclude name="WordPress.Classes.ClassInstantiation.MissingParenthesis" /> |
114 | 125 | </rule> |
115 | 126 |
|
| 127 | + <rule ref="WordPress.PHP.StrictInArray"/> |
| 128 | + <rule ref="WordPress.DB.PreparedSQLPlaceholders"/> |
| 129 | + <rule ref="WordPress.CodeAnalysis.EmptyStatement"/> |
| 130 | + <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> |
| 131 | + <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> |
| 132 | + <rule ref="WordPress.DB.RestrictedFunctions"/> |
| 133 | + <rule ref="WordPress.DB.RestrictedClasses"/> |
| 134 | + <rule ref="WordPress.PHP.DevelopmentFunctions"/> |
| 135 | + <rule ref="WordPress.PHP.DiscouragedPHPFunctions"/> |
| 136 | + <rule ref="WordPress.WP.AlternativeFunctions"/> |
| 137 | + <rule ref="WordPress.WP.DiscouragedConstants"/> |
| 138 | + <rule ref="WordPress.WP.DiscouragedFunctions"/> |
| 139 | + <rule ref="WordPress.WP.EnqueuedResources"/> |
| 140 | + <rule ref="WordPress.NamingConventions.PrefixAllGlobals"/> |
| 141 | + |
116 | 142 | <rule ref="Wordpress-Docs"> |
117 | 143 | <exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" /> |
118 | 144 | </rule> |
119 | 145 |
|
120 | 146 | <rule ref="WordPress.WP.DeprecatedClasses"> |
121 | 147 | <properties> |
122 | | - <property name="minimum_supported_version" value="4.6"/> |
| 148 | + <property name="minimum_supported_version" value="4.7"/> |
123 | 149 | </properties> |
124 | 150 | </rule> |
125 | 151 |
|
126 | | - |
127 | 152 | <rule ref="WordPress.WP.DeprecatedFunctions"> |
128 | 153 | <properties> |
129 | | - <property name="minimum_supported_version" value="4.6"/> |
| 154 | + <property name="minimum_supported_version" value="4.7"/> |
130 | 155 | </properties> |
131 | 156 | </rule> |
132 | 157 |
|
133 | 158 | <rule ref="WordPress.WP.DeprecatedParameters"> |
134 | 159 | <properties> |
135 | | - <property name="minimum_supported_version" value="4.6"/> |
| 160 | + <property name="minimum_supported_version" value="4.7"/> |
136 | 161 | </properties> |
137 | 162 | </rule> |
138 | 163 |
|
| 164 | + <rule ref="WordPress.Functions.DontExtract"> |
| 165 | + <type>warning</type> |
| 166 | + </rule> |
| 167 | + <!-- Prepare all SQL queries. --> |
| 168 | + <rule ref="WordPress.WP.PreparedSQL"> |
| 169 | + <type>warning</type> |
| 170 | + </rule> |
139 | 171 |
|
| 172 | + <!-- Escape all non-hard-coded output. --> |
| 173 | + <rule ref="WordPress.XSS.EscapeOutput"> |
| 174 | + <type>warning</type> |
| 175 | + </rule> |
| 176 | + <!-- Verify that a nonce check is done before using values in superglobals. --> |
| 177 | + <rule ref="WordPress.CSRF.NonceVerification"> |
| 178 | + <type>warning</type> |
| 179 | + </rule> |
| 180 | + |
| 181 | + <!-- Superglobal input not validated or sanitized. --> |
| 182 | + <rule ref="WordPress.VIP.ValidatedSanitizedInput"> |
| 183 | + <type>warning</type> |
| 184 | + </rule> |
| 185 | + |
| 186 | + <rule ref="Generic.CodeAnalysis.EmptyStatement"> |
| 187 | + <type>warning</type> |
| 188 | + </rule> |
| 189 | + <rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"> |
| 190 | + <type>warning</type> |
| 191 | + </rule> |
140 | 192 | <rule ref="WordPress.WP.I18n"> |
141 | 193 | <properties> |
142 | 194 | <property name="text_domain" type="array" value="glossary,woo-fiscalita-italiana,genesis"/> |
|
0 commit comments