Use composer to install PHPCS and friends on Travis#1291
Use composer to install PHPCS and friends on Travis#1291grappler wants to merge 2 commits intoAutomattic:masterfrom
Conversation
PHPCS is loaded automatically as a dependency
70b8402 to
af73a47
Compare
.travis.yml
Outdated
| # Install PHP Compatibility sniffs. | ||
| - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $PHPCOMPAT_DIR; fi | ||
| # Install WordPress Coding Standards & PHP Compatibility sniffs. | ||
| - if [[ "$SNIFF" == "1" ]]; then composer global require wp-coding-standards/wpcs:~0.14.1 wimg/php-compatibility:dev-master --prefer-stable --no-interaction --no-suggest; fi |
There was a problem hiding this comment.
Please add dealerdirect/phpcodesniffer-composer-installer:^0.4.3. This is a Composer plugin which will sort out the installed paths automatically and is suggested for that reason by both the standards.
.travis.yml
Outdated
| # Set install path for PHPCS sniffs. | ||
| # @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941 | ||
| - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --config-set installed_paths $WPCS_DIR,$PHPCOMPAT_DIR; fi | ||
| - if [[ "$SNIFF" == "1" ]]; then phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/wimg/php-compatibility; fi |
There was a problem hiding this comment.
If the above mentioned Composer plugin is added, this line can be removed completely.
|
Interesting approach doing this without a Regarding the build failure: this has to do with a change in PHPCS - see squizlabs/PHP_CodeSniffer#1539. Please note that the version which would currently be used, |
Replaces the need to set the sniffs path manually
|
Closing as composer was added in #1386. |
Changes proposed in this Pull Request:
Use composer instead of git to install WPCS and PHPCompatibility. This was recommend in a previous PR #1183 (comment)
Changing the flow to a0d2892
Only use the development version of PHPCompatibility. With this change we would use the stable version of PHPCS. Due to an update to the PHPCS master the checks are failing. I would like to the necessary changes to happen along side the PHPCS and WPCS updates instead of having to do them with other changes.
Related issue(s):
#1267