Updated Upgrade Guide to WordPressCS 3.0.0 for ruleset maintainers (markdown)

Gary Jones 2023-08-20 18:20:03 +01:00
parent 603d9b8f6f
commit 75491694b3

@ -1,8 +1,8 @@
### Updating your installation to WordPressCS 3.0.0
#### Composer project based install
#### Composer project-based install
If you were already using a Composer project based install, upgrade WordPressCS by running:
If you were already using a Composer project-based install, upgrade WordPressCS by running:
```bash
composer remove --dev dealerdirect/phpcodesniffer-composer-installer higidi/composer-phpcodesniffer-standards-plugin squizlabs/PHP_codesniffer
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
@ -20,20 +20,18 @@ composer global require --dev wp-coding-standards/wpcs:"^3.0.0" --update-with-de
#### Installs based on the old installation instructions
If you were using a Composer install which was created using the `composer create-project` command or had downloaded the release zip directly, please throw away the directory in which you had WordPressCS installed and follow the new installation instructions in the [Readme](https://github.com/WordPress/WordPress-Coding-Standards/blob/main/README.md#installation) to install WordPressCS from scratch.
If you were using a Composer install which was created using the `composer create-project` command or had downloaded the release zip directly, please delete the directory in which you had WordPressCS installed and follow the new installation instructions in the [Readme](https://github.com/WordPress/WordPress-Coding-Standards/blob/main/README.md#installation) to install WordPressCS from scratch.
#### Other types of installs
If you were using a stand-alone install of PHP_CodeSniffer, like a git clone, PHAR or PEAR install, with which you had registered WordPressCS using the `installed_paths` command:
While using WordPressCS like this is still possible, no support will be given anymore for such installs.
We strongly recommend you change over to using a [Composer](https://getcomposer.org/) based install instead.
If you were using a stand-alone install of PHP_CodeSniffer, like a git clone, PHAR, or PEAR install, with which you had registered WordPressCS using the `installed_paths` command, we strongly recommend you use a [Composer](https://getcomposer.org/) based install instead. While installing WordPressCS without Composer is still possible, no support will be given anymore for such installs.
Also note that the `master` branch has been renamed to `main`.
Also, note that the `master` branch has been renamed to `main`.
#### Removing artifacts from old installation methods
If you have a `<config name="installed_paths" value="/path/to/wpcs" />` directive in your `phpcs.xml[.dist]` ruleset file: please remove it.
If you have a `<config name="installed_paths" value="/path/to/wpcs" />` directive in your `[.]phpcs.xml[.dist]` ruleset file, please remove it.
The [Composer PHPCS plugin] is now included by default and will take care of setting the installed paths for Composer based installs.
@ -44,7 +42,7 @@ You may need to re-run `composer install` after removing these artifacts.
### CI integration
If you had set up your CI integration based on the old example scripts, you may want to change this now to use a Composer based CI integration. Please see the [Wiki](https://github.com/WordPress/WordPress-Coding-Standards/wiki) for updated example scripts for both GitHub Actions as well as Travis.
If you had set up your CI integration based on the old example scripts, please change this to use a Composer based CI integration. Please see the [Wiki](https://github.com/WordPress/WordPress-Coding-Standards/wiki) for updated example scripts for both GitHub Actions as well as Travis.
### "Old-style"/WordPressCS native ignore annotations
@ -136,7 +134,7 @@ The following properties which can be set in a custom ruleset have been renamed.
| `WordPress.WP.DeprecatedParameterValues` | `minimum_supported_version` | `minimum_wp_version` |
| `WordPress.WP.GlobalVariablesOverride` | `custom_test_class_whitelist` | `custom_test_classes` |
If you use any of these properties, you will need to update your ruleset to use the new name instead.
If you use any of these properties, you will need to update your ruleset to use the new name instead. Yes, two of them are intentionally in camel case.
Additionally, the following properties have been removed:
@ -165,7 +163,7 @@ The `minimum_supported_wp_version` config setting, which can be set at runtime b
Please read the changelog carefully before upgrading.
This release contains **_lots_** of bugfixes, so if you'd previously ignored certain issues, either from the ruleset or using the PHPCS selective ignore annotations, because of bugs in sniffs, you may want to review your ignore annotations using the `--ignore-annotations` CLI option and/or re-enable those sniffs.
This release contains **_lots_** of bugfixes, so if you'd previously ignored certain issues, either from the ruleset or using the PHPCS selective ignore annotations, because of bugs in sniffs, please review your ignore annotations using the `--ignore-annotations` CLI option and/or re-enable those sniffs.
[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer