Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHPCS/Composer: update PHPCS related dependencies
Composer: * Switches the repo over to use `PHPCompatibilityWP` rather than `PHPCompatibility`. As this repo and ruleset is for a WordPress project, using the `PHPCompatibilityWP` ruleset is the better choice to prevent false positives for PHP functions and constants which are back-filled by WP. Includes updating the underlying PHPCompatibility dependency. You were missing out on a lot of new checks, including the checks to make sure your code is compatible with the recently released PHP 7.4. * Use the latest version of the DealerDirect Composer PHPCS plugin. Composer treats minors < 1.0 as majors, so you need to explicitly update. * Use the latest version of WPCS. * Remove the PHPCS dependency. This is not _your_ dependency, but a dependency of WPCS and PHPCompatibility, so let Composer sort out a version supported by both. * Update the scripts to point to the versions of tooling installed via Composer, rather than presuming there will globally installed versions somewhere on contributor's systems. * Remove the command line arguments form the PHPCS `lint` command. First off, the `inc/*` doesn't work anyway. Secondly, this is contained in the ruleset anyway, so no need to pass this information here. Includes removing the `-v` as this is only needed when debugging. PHPCS ruleset: * Rename the ruleset to `phpcs.xml.dist`. This allows devs to overload the file using `[.]phpcs.xml`. Includes adding the file names of the supported overload files to `.gitignore`. * Do an open-ended check for cross-version compatibility. No need to limit this the checks to PHP `5.6-7.2`. Leaving the "up to" open ended will allow for receiving information about incompatibility with any PHP version from 5.6 up. * Minor ruleset tweak related to long vs short arrays. WPCS demands long arrays as of WPCS 2.2.0. This repo uses short arrays, so enforce that instead. * Updating the excluded error codes for the `WordPress.NamingConventions.ValidVariableName` sniff. These were renamed in WPCS 2.0.0. Ref: * https://github.com/PHPCompatibility/PHPCompatibilityWP * PHPCompatibility/PHPCompatibility#688 * https://github.com/WordPress/WordPress-Coding-Standards/releases/ * https://github.com/Dealerdirect/phpcodesniffer-composer-installer/releases/
- Loading branch information