Skip to content

Commit f182701

Browse files
committed
4.0 | Wiki: update for removed sniffs using external tooling
1 parent 6d4563a commit f182701

File tree

2 files changed

+109
-116
lines changed

2 files changed

+109
-116
lines changed

wiki/Configuration-Options.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -229,33 +229,33 @@ $ phpcs --config-set ignore_non_auto_fixable_on_exit 1
229229
<p align="right"><a href="#table-of-contents">back to top</a></p>
230230
231231
232-
## Generic Coding Standard Configuration Options
232+
## Setting tool paths
233233
234-
### Setting the path to CSSLint
234+
### Setting the path to PHP
235235
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.
237237
238238
```bash
239-
$ phpcs --config-set csslint_path /path/to/csslint
239+
$ phpcs --config-set php_path /path/to/php
240240
```
241241
242-
### Setting the path to the Google Closure Linter
242+
### Setting the path to CSSLint (PHP_CodeSniffer < 4.0.0)
243243
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.
245245
246246
```bash
247-
$ phpcs --config-set gjslint_path /path/to/gjslint
247+
$ phpcs --config-set csslint_path /path/to/csslint
248248
```
249249
250-
### Setting the path to PHP
250+
### Setting the path to the Google Closure Linter (PHP_CodeSniffer < 4.0.0)
251251
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.
253253
254254
```bash
255-
$ phpcs --config-set php_path /path/to/php
255+
$ phpcs --config-set gjslint_path /path/to/gjslint
256256
```
257257
258-
### Setting the path to JSHint
258+
### Setting the path to JSHint (PHP_CodeSniffer < 4.0.0)
259259
260260
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.
261261
@@ -269,12 +269,7 @@ As JSHint is just JavaScript code, you may also need to install [Rhino](https://
269269
$ phpcs --config-set rhino_path /path/to/rhino
270270
```
271271
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)
278273
279274
The `Squiz.Debug.JSLint` sniff will check each JavaScript file using [JSLint](http://www.jslint.com/), a JavaScript program that looks for problems in JavaScript programs. Use the `jslint_path` configuration option to tell the JSLint sniff where to find the tool.
280275
@@ -288,19 +283,14 @@ As JSLint is just JavaScript code, you may also need to install [Rhino](https://
288283
$ phpcs --config-set rhino_path /path/to/rhino
289284
```
290285
291-
### Setting the path to JavaScript Lint
286+
### Setting the path to JavaScript Lint (PHP_CodeSniffer < 4.0.0)
292287
293288
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.
294289
295290
```bash
296291
$ phpcs --config-set jsl_path /path/to/jsl
297292
```
298293
299-
<p align="right"><a href="#table-of-contents">back to top</a></p>
300-
301-
302-
## Zend Coding Standard Configuration Options
303-
304294
### Setting the path to the Zend Code Analyzer (PHP_CodeSniffer < 4.0.0)
305295
306296
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.

wiki/Customisable-Sniff-Properties.md

Lines changed: 96 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -79,61 +79,6 @@ If the `error` property is set to `false`, a warning will be thrown for violatio
7979
<p align="right"><a href="#table-of-contents">back to top</a></p>
8080

8181

82-
### Generic.Debug.ClosureLinter
83-
84-
| Property Name | Type | Default | Available Since |
85-
| ------------- | ----- | ------- | --------------- |
86-
| errorCodes | array | [] | - |
87-
| ignoreCodes | array | [] | - |
88-
89-
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-
<rule ref="Generic.Debug.ClosureLinter">
100-
<properties>
101-
<property name="errorCodes" type="array">
102-
<element value="0210"/>
103-
</property>
104-
<property name="ignoreCodes" type="array">
105-
<element value="0001"/>
106-
<element value="0110"/>
107-
<element value="0240"/>
108-
</property>
109-
</properties>
110-
</rule>
111-
```
112-
113-
<p align="right"><a href="#table-of-contents">back to top</a></p>
114-
115-
116-
### Generic.Debug.ESLint
117-
118-
| Property Name | Type | Default | Available Since |
119-
| ------------- | ------ | ------- | --------------- |
120-
| configFile | string | - | 2.9.0 |
121-
122-
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.
125-
126-
```xml
127-
<rule ref="Generic.Debug.ESLint">
128-
<properties>
129-
<property name="configFile" value="/path/to/.eslintrc.json"/>
130-
</properties>
131-
</rule>
132-
```
133-
134-
<p align="right"><a href="#table-of-contents">back to top</a></p>
135-
136-
13782
### Generic.Files.LineEndings
13883

13984
| Property Name | Type | Default | Available Since |
@@ -1421,44 +1366,6 @@ Two of the rules that this sniff enforces are the indent of `case` and `default`
14211366
<p align="right"><a href="#table-of-contents">back to top</a></p>
14221367

14231368

1424-
### Squiz.CSS.ForbiddenStyles
1425-
1426-
| Property Name | Type | Default | Available Since |
1427-
| ------------- | ---- | ------- | --------------- |
1428-
| error | bool | true | 1.4.6 |
1429-
1430-
If the `error` property is set to `false`, a warning will be thrown for violations instead of an error.
1431-
1432-
```xml
1433-
<rule ref="Squiz.CSS.ForbiddenStyles">
1434-
<properties>
1435-
<property name="error" value="false" />
1436-
</properties>
1437-
</rule>
1438-
```
1439-
1440-
<p align="right"><a href="#table-of-contents">back to top</a></p>
1441-
1442-
1443-
### Squiz.CSS.Indentation
1444-
1445-
| Property Name | Type | Default | Available Since |
1446-
| ------------- | ---- | ------- | --------------- |
1447-
| indent | int | 4 | 1.4.7 |
1448-
1449-
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-
<rule ref="Squiz.CSS.Indentation">
1453-
<properties>
1454-
<property name="indent" value="2" />
1455-
</properties>
1456-
</rule>
1457-
```
1458-
1459-
<p align="right"><a href="#table-of-contents">back to top</a></p>
1460-
1461-
14621369
### Squiz.Functions.FunctionDeclaration
14631370

14641371
| 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
17831690
```
17841691

17851692
<p align="right"><a href="#table-of-contents">back to top</a></p>
1693+
1694+
1695+
## Deprecated/Removed Sniffs
1696+
1697+
### Generic.Debug.ClosureLinter (PHP_CodeSniffer < 4.0.0)
1698+
1699+
| Property Name | Type | Default | Available Since | Deprecated | Removed |
1700+
| ------------- | ----- | ------- | --------------- | ---------- | ------- |
1701+
| errorCodes | array | [] | - | 3.9.0 | 4.0.0 |
1702+
| ignoreCodes | array | [] | - | 3.9.0 | 4.0.0 |
1703+
1704+
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+
<rule ref="Generic.Debug.ClosureLinter">
1715+
<properties>
1716+
<property name="errorCodes" type="array">
1717+
<element value="0210"/>
1718+
</property>
1719+
<property name="ignoreCodes" type="array">
1720+
<element value="0001"/>
1721+
<element value="0110"/>
1722+
<element value="0240"/>
1723+
</property>
1724+
</properties>
1725+
</rule>
1726+
```
1727+
1728+
<p align="right"><a href="#table-of-contents">back to top</a></p>
1729+
1730+
1731+
### Generic.Debug.ESLint (PHP_CodeSniffer < 4.0.0)
1732+
1733+
| Property Name | Type | Default | Available Since | Deprecated | Removed |
1734+
| ------------- | ------ | ------- | --------------- | ---------- | ------- |
1735+
| configFile | string | - | 2.9.0 | 3.9.0 | 4.0.0 |
1736+
1737+
1738+
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.
1741+
1742+
```xml
1743+
<rule ref="Generic.Debug.ESLint">
1744+
<properties>
1745+
<property name="configFile" value="/path/to/.eslintrc.json"/>
1746+
</properties>
1747+
</rule>
1748+
```
1749+
1750+
<p align="right"><a href="#table-of-contents">back to top</a></p>
1751+
1752+
1753+
### Squiz.CSS.ForbiddenStyles (PHP_CodeSniffer < 4.0.0)
1754+
1755+
| Property Name | Type | Default | Available Since | Deprecated | Removed |
1756+
| ------------- | ---- | ------- | --------------- | ---------- | ------- |
1757+
| error | bool | true | 1.4.6 | 3.9.0 | 4.0.0 |
1758+
1759+
If the `error` property is set to `false`, a warning will be thrown for violations instead of an error.
1760+
1761+
```xml
1762+
<rule ref="Squiz.CSS.ForbiddenStyles">
1763+
<properties>
1764+
<property name="error" value="false" />
1765+
</properties>
1766+
</rule>
1767+
```
1768+
1769+
<p align="right"><a href="#table-of-contents">back to top</a></p>
1770+
1771+
1772+
### Squiz.CSS.Indentation (PHP_CodeSniffer < 4.0.0)
1773+
1774+
| Property Name | Type | Default | Available Since | Deprecated | Removed |
1775+
| ------------- | ---- | ------- | --------------- | ---------- | ------- |
1776+
| indent | int | 4 | 1.4.7 | 3.9.0 | 4.0.0 |
1777+
1778+
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+
<rule ref="Squiz.CSS.Indentation">
1782+
<properties>
1783+
<property name="indent" value="2" />
1784+
</properties>
1785+
</rule>
1786+
```
1787+
1788+
<p align="right"><a href="#table-of-contents">back to top</a></p>

0 commit comments

Comments
 (0)