Commit 595da31
committed
WPCS 2.0.0: Remove the PHPCSAliases file
After extensive testing based on issues which were previously reported, I've concluded that the `PHPCSAliases.php` file can now be safely removed.
Test setup I've used to confirm this:
* Clean Composer install of PHPCS + WPCS _without the `installed_paths` config directive being set.
```json
{
"require": {},
"require-dev": {
"squizlabs/php_codesniffer": "^3.3",
"wp-coding-standards/wpcs": "^1.1"
}
}
```
* Basic PHPCS ruleset:
```xml
<?xml version="1.0"?>
<ruleset name="AliasFileTest">
<file>.</file>
<exclude-pattern>vendor/*</exclude-pattern>
<arg value="p"/>
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs"/>
<rule ref="WordPress"/>
</ruleset>
```
* A PHP test file which would generate issues.
Tests I've run:
* Running `vendor/bin/phpcs` on the above (which would be with WPCS 1.2.1) works fine.
* Changed the `config` directive value to point to my local WPCS dev install:
`<config name="installed_paths" value="I:/path/to/WordPress-Coding-Standards/WordPress-Coding-Standards"/>`
* Tested again against the `develop` branch, still was working fine.
* Now we get to the interesting part: changed to this branch and ran it again. Still working fine.
* Changed the `<rule ref..>` to `<rule ref="WordPress-Core"/>` and still working fine.
* Changed the `<rule ref..>` to `<rule ref="WordPress.Security"/>`, i.e. not a registered standard, but a subcategory and still working fine.
Based on all this, I'm concluding that the WPCS autoloader in the PHPCSAlias file is no longer needed and can now be safely removed.
Refs:
* 1087
* squizlabs/PHP_CodeSniffer 15911 parent e73a10e commit 595da31
File tree
4 files changed
+0
-52
lines changed- WordPress-Core
- WordPress-Extra
- WordPress
4 files changed
+0
-52
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| |||
0 commit comments