You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p align="right"><a href="#table-of-contents">back to top</a></p>
230
230
231
231
232
-
## Generic Coding Standard Configuration Options
232
+
## Setting tool paths
233
233
234
-
### Setting the path to CSSLint
234
+
### Setting the path to PHP
235
235
236
-
The `Generic.Debug.CSSLint` sniff will check each CSS file using [CSS Lint](http://csslint.net/). Use the `csslint_path` configuration option to tell the CSSLint sniff where to find the tool.
236
+
The `Generic.PHP.Syntax` sniff will check the syntax of each PHP file using [the built-in PHP linter](http://php.net/manual/en/features.commandline.options.php). Use the `php_path` configuration option to tell the Syntax sniff where to find the PHP binary.
### Setting the path to CSSLint (PHP_CodeSniffer < 4.0.0)
243
243
244
-
The `Generic.Debug.ClosureLinter` sniff will check each file using the [Google Closure Linter](https://github.com/google/closure-linter), an open source JavaScript style checker from Google. Use the `gjslint_path` configuration option to tell the Google Closure Linter sniff where to find the tool.
244
+
The `Generic.Debug.CSSLint` sniff will check each CSS file using [CSS Lint](http://csslint.net/). Use the `csslint_path` configuration option to tell the CSSLint sniff where to find the tool.
### Setting the path to the Google Closure Linter (PHP_CodeSniffer < 4.0.0)
251
251
252
-
The `Generic.PHP.Syntax` sniff will check the syntax of each PHP file using [the built-in PHP linter](http://php.net/manual/en/features.commandline.options.php). Use the `php_path` configuration option to tell the Syntax sniff where to find the PHP binary.
252
+
The `Generic.Debug.ClosureLinter` sniff will check each file using the [Google Closure Linter](https://github.com/google/closure-linter), an open source JavaScript style checker from Google. Use the `gjslint_path` configuration option to tell the Google Closure Linter sniff where to find the tool.
### Setting the path to JSHint (PHP_CodeSniffer < 4.0.0)
259
259
260
260
The `Generic.Debug.JSHint` sniff will check each JavaScript file using [JSHint](http://www.jshint.com/), a tool to detect errors and potential problems in JavaScript code. Use the `jshint_path` configuration option to tell the JSHint sniff where to find the tool.
261
261
@@ -269,12 +269,7 @@ As JSHint is just JavaScript code, you may also need to install [Rhino](https://
269
269
$ phpcs --config-set rhino_path /path/to/rhino
270
270
```
271
271
272
-
<p align="right"><a href="#table-of-contents">back to top</a></p>
273
-
274
-
275
-
## Squiz Coding Standard Configuration Options
276
-
277
-
### Setting the path to JSLint
272
+
### Setting the path to JSLint (PHP_CodeSniffer < 4.0.0)
278
273
279
274
The `Squiz.Debug.JSLint` sniff will check each JavaScript file using [JSLint](http://www.jslint.com/), a JavaScript program that looks forproblemsin JavaScript programs. Use the `jslint_path` configuration option to tell the JSLint sniff where to find the tool.
280
275
@@ -288,19 +283,14 @@ As JSLint is just JavaScript code, you may also need to install [Rhino](https://
288
283
$ phpcs --config-set rhino_path /path/to/rhino
289
284
```
290
285
291
-
### Setting the path to JavaScript Lint
286
+
### Setting the path to JavaScript Lint (PHP_CodeSniffer < 4.0.0)
292
287
293
288
The `Squiz.Debug.JavascriptLint` sniff will check each JavaScript file using [JavaScript Lint](http://www.javascriptlint.com/), a tool that checks all your JavaScript source code for common mistakes without actually running the script or opening the web page. Use the `jsl_path` configuration option to tell the JavaScript Lint sniff where to find the tool.
294
289
295
290
```bash
296
291
$ phpcs --config-set jsl_path /path/to/jsl
297
292
```
298
293
299
-
<p align="right"><a href="#table-of-contents">back to top</a></p>
300
-
301
-
302
-
## Zend Coding Standard Configuration Options
303
-
304
294
### Setting the path to the Zend Code Analyzer (PHP_CodeSniffer < 4.0.0)
305
295
306
296
The `Zend.Debug.CodeAnalyzer` sniff will check each file using the Zend Code Analyzer, a tool that comes with Zend Studio. Use the `zend_ca_path` configuration option to tell the Zend Code Analyzer sniff where to find the tool.
The `Generic.Debug.ClosureLinter` sniff runs the [Google Closure Linter](https://github.com/google/closure-linter) tool over JavaScript files and reports errors that the tool finds. All found errors are reported as PHP_CodeSniffer warnings by default.
90
-
91
-
There are two configurable options:
92
-
*`errorCodes` : a list of error codes that should show as errors instead of warnings
93
-
*`ignoreCodes` : a list of error codes that should be ignored
94
-
95
-
> [!NOTE]
96
-
> The error codes accepted by this sniff are the 4-digit codes generated by the `gjslint` tool and displayed in the warning messages produced by this sniff.
97
-
98
-
```xml
99
-
<ruleref="Generic.Debug.ClosureLinter">
100
-
<properties>
101
-
<propertyname="errorCodes"type="array">
102
-
<elementvalue="0210"/>
103
-
</property>
104
-
<propertyname="ignoreCodes"type="array">
105
-
<elementvalue="0001"/>
106
-
<elementvalue="0110"/>
107
-
<elementvalue="0240"/>
108
-
</property>
109
-
</properties>
110
-
</rule>
111
-
```
112
-
113
-
<palign="right"><ahref="#table-of-contents">back to top</a></p>
114
-
115
-
116
-
### Generic.Debug.ESLint
117
-
118
-
| Property Name | Type | Default | Available Since |
The `Generic.Debug.ESLint` sniff runs the [ESLint](https://eslint.org/) tool over JavaScript files and reports errors that the tool finds. All found violations are reported as either PHP_CodeSniffer errors or warnings based on the severity level that the ESLint tool provides.
123
-
124
-
The sniff will attempt to auto-discover an ESLint config file in the current directory, but a config file path can also be specified by setting the `configFile` property.
This sniff checks the indentation of CSS class definitions. By default, this sniff ensures that style statements are indented using 4 spaces, but you can change the size of the indent by setting the `indent` property.
1450
-
1451
-
```xml
1452
-
<ruleref="Squiz.CSS.Indentation">
1453
-
<properties>
1454
-
<propertyname="indent"value="2" />
1455
-
</properties>
1456
-
</rule>
1457
-
```
1458
-
1459
-
<palign="right"><ahref="#table-of-contents">back to top</a></p>
1460
-
1461
-
1462
1369
### Squiz.Functions.FunctionDeclaration
1463
1370
1464
1371
| Property Name | Type | Default | Available Since |
@@ -1783,3 +1690,99 @@ Some of the rules this sniff enforces are that there should not be whitespace at
1783
1690
```
1784
1691
1785
1692
<palign="right"><ahref="#table-of-contents">back to top</a></p>
The `Generic.Debug.ClosureLinter` sniff runs the [Google Closure Linter](https://github.com/google/closure-linter) tool over JavaScript files and reports errors that the tool finds. All found errors are reported as PHP_CodeSniffer warnings by default.
1705
+
1706
+
There are two configurable options:
1707
+
*`errorCodes` : a list of error codes that should show as errors instead of warnings
1708
+
*`ignoreCodes` : a list of error codes that should be ignored
1709
+
1710
+
> [!NOTE]
1711
+
> The error codes accepted by this sniff are the 4-digit codes generated by the `gjslint` tool and displayed in the warning messages produced by this sniff.
1712
+
1713
+
```xml
1714
+
<ruleref="Generic.Debug.ClosureLinter">
1715
+
<properties>
1716
+
<propertyname="errorCodes"type="array">
1717
+
<elementvalue="0210"/>
1718
+
</property>
1719
+
<propertyname="ignoreCodes"type="array">
1720
+
<elementvalue="0001"/>
1721
+
<elementvalue="0110"/>
1722
+
<elementvalue="0240"/>
1723
+
</property>
1724
+
</properties>
1725
+
</rule>
1726
+
```
1727
+
1728
+
<palign="right"><ahref="#table-of-contents">back to top</a></p>
The `Generic.Debug.ESLint` sniff runs the [ESLint](https://eslint.org/) tool over JavaScript files and reports errors that the tool finds. All found violations are reported as either PHP_CodeSniffer errors or warnings based on the severity level that the ESLint tool provides.
1739
+
1740
+
The sniff will attempt to auto-discover an ESLint config file in the current directory, but a config file path can also be specified by setting the `configFile` property.
This sniff checks the indentation of CSS class definitions. By default, this sniff ensures that style statements are indented using 4 spaces, but you can change the size of the indent by setting the `indent` property.
1779
+
1780
+
```xml
1781
+
<ruleref="Squiz.CSS.Indentation">
1782
+
<properties>
1783
+
<propertyname="indent"value="2" />
1784
+
</properties>
1785
+
</rule>
1786
+
```
1787
+
1788
+
<palign="right"><ahref="#table-of-contents">back to top</a></p>
0 commit comments