forked from mirror/_s
🔧 Travis: update the versions used by the various PHPCS libaries
As WPCS and PHPCompatibility were for a little while (May - July 2017) not compatible with PHPCS 3.x, the library tags cloned were previously fixed to prevent issues with that. As both WPCS as well as the PHPCompatibility standard are now compatible with PHPCS 3.x, the changes made in PR 1110 and PR 1183 can be reverted. Notes: * PHPCS - use `master`. WPCS uses a limited set of sniffs from PHPCS itself. Most of these sniffs are long established, stable and rarely get updated, so using PHPCS `master` should be safe. * WPCS - use the latest release `0.14.0`. WPCS is the main source of CS violations and is under active development. This means that new versions of WPCS will easily break the build, so should be managed. * PHPCompatibility - use `master`. PHPCompatibility checks PHP cross-version compatibility. It is actively developed and heavily unit tested, so any new violations found in `_s` because of changes in that library, should actually be addressed in `_s` ASAP. The PHPCompatibility library became compatible with PHPCS 3.x and improved compatibility with Composer installs in version `8.0.0` which was a breaking change. To account for that, the location where the library is cloned to and the `phpcs --installed_paths` command have been updated. Ref: https://github.com/wimg/PHPCompatibility/pull/446
This commit is contained in:
parent
05511d4846
commit
a0d2892cad
13
.travis.yml
13
.travis.yml
|
@ -47,16 +47,17 @@ matrix:
|
||||||
# Failures in this section will result in build status 'errored'.
|
# Failures in this section will result in build status 'errored'.
|
||||||
before_script:
|
before_script:
|
||||||
- export PHPCS_DIR=/tmp/phpcs
|
- export PHPCS_DIR=/tmp/phpcs
|
||||||
- export SNIFFS_DIR=/tmp/sniffs
|
- export WPCS_DIR=/tmp/wpcs
|
||||||
|
- export PHPCOMPAT_DIR=/tmp/phpcompatibility
|
||||||
# Install CodeSniffer for WordPress Coding Standards checks.
|
# Install CodeSniffer for WordPress Coding Standards checks.
|
||||||
- if [[ "$SNIFF" == "1" ]]; then git clone -b 2.9.1 --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi
|
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi
|
||||||
# Install WordPress Coding Standards.
|
# Install WordPress Coding Standards.
|
||||||
- if [[ "$SNIFF" == "1" ]]; then git clone -b 0.11.0 --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR; fi
|
- if [[ "$SNIFF" == "1" ]]; then git clone -b 0.14.1 --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR; fi
|
||||||
# Install PHP Compatibility sniffs.
|
# Install PHP Compatibility sniffs.
|
||||||
- if [[ "$SNIFF" == "1" ]]; then git clone -b 7.1.5 --depth 1 https://github.com/wimg/PHPCompatibility.git $SNIFFS_DIR/PHPCompatibility; fi
|
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $PHPCOMPAT_DIR; fi
|
||||||
# Set install path for PHPCS sniffs.
|
# Set install path for PHPCS sniffs.
|
||||||
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
|
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
|
||||||
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs --config-set installed_paths $SNIFFS_DIR; fi
|
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --config-set installed_paths $WPCS_DIR,$PHPCOMPAT_DIR; fi
|
||||||
# After CodeSniffer install you should refresh your path.
|
# After CodeSniffer install you should refresh your path.
|
||||||
- if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi
|
- if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi
|
||||||
# Install JSCS: JavaScript Code Style checker.
|
# Install JSCS: JavaScript Code Style checker.
|
||||||
|
@ -83,7 +84,7 @@ script:
|
||||||
# @link https://pear.php.net/package/PHP_CodeSniffer/
|
# @link https://pear.php.net/package/PHP_CodeSniffer/
|
||||||
# Uses a custom ruleset based on WordPress. This ruleset is automatically
|
# Uses a custom ruleset based on WordPress. This ruleset is automatically
|
||||||
# picked up by PHPCS as it's named `phpcs.xml(.dist)`.
|
# picked up by PHPCS as it's named `phpcs.xml(.dist)`.
|
||||||
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs; fi
|
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs; fi
|
||||||
|
|
||||||
# Receive notifications for build results.
|
# Receive notifications for build results.
|
||||||
# @link https://docs.travis-ci.com/user/notifications/#Email-notifications
|
# @link https://docs.travis-ci.com/user/notifications/#Email-notifications
|
||||||
|
|
Reference in New Issue