Skip to content

Commit e34c0b5

Browse files
author
Joost de Valk
authored
Merge pull request #264 from Yoast/JRF/CI/use-parallel-lint
Travis/Composer: switch over to parallel linting of PHP files
2 parents 5742a3b + f1fd480 commit e34c0b5

3 files changed

Lines changed: 161 additions & 5 deletions

File tree

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,18 @@ before_install:
4040
- if [[ "$CHECKJS" == "1" ]]; then export PATH=$HOME/.yarn/bin:$PATH; fi
4141

4242
install:
43-
- if [[ "$PHPUNIT" == "1" ]]; then composer install --no-interaction; fi
43+
- |
44+
if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
45+
composer install --prefer-dist --no-interaction --ignore-platform-reqs
46+
else
47+
composer install --prefer-dist --no-interaction
48+
fi
4449
- if [[ "$CHECKJS" == "1" ]]; then yarn global add grunt-cli; fi
4550
- if [[ "$CHECKJS" == "1" ]]; then yarn install; fi
4651
- if [[ "$SECURITY" == "1" ]]; then wget -P $SECURITYCHECK_DIR https://get.sensiolabs.org/security-checker.phar && chmod +x $SECURITYCHECK_DIR/security-checker.phar;fi
4752

4853
script:
49-
- if find -L . -path ./vendor -prune -o -path ./node_modules -prune -o -name '*.php' -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi
50-
# Run PHPCS separately for the plugin files and the test files.
54+
- composer lint
5155
- if [[ "$PHPCS" == "1" ]]; then composer check-cs; fi
5256
- if [[ "$CHECKJS" == "1" ]]; then grunt check; fi
5357
- if [[ "$PHPUNIT" == "1" ]]; then composer test; fi

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
"require-dev": {
5151
"brain/monkey": "^2.4.0",
5252
"phpunit/phpunit": "^5.4 || ^6.0 || ^7.0",
53-
"yoast/yoastcs": "^2.0.0"
53+
"yoast/yoastcs": "^2.0.0",
54+
"php-parallel-lint/php-parallel-lint": "^1.2",
55+
"php-parallel-lint/php-console-highlighter": "^0.5"
5456
},
5557
"autoload": {
5658
"classmap": [ "inc" ]
@@ -68,6 +70,9 @@
6870
}
6971
},
7072
"scripts": {
73+
"lint": [
74+
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude node_modules --exclude .git"
75+
],
7176
"test": [
7277
"@php ./vendor/phpunit/phpunit/phpunit --colors=always"
7378
],

composer.lock

Lines changed: 148 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)