Skip to content

Commit

Permalink
Merge pull request #7473 from Majkl578/incremental-cs-2.x
Browse files Browse the repository at this point in the history
Incremental CS checks in 2.x branches
  • Loading branch information
Majkl578 authored Dec 10, 2018
2 parents 74e6189 + 78c7000 commit 493ff74
Show file tree
Hide file tree
Showing 5 changed files with 2,826 additions and 10 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ lib/Doctrine/DBAL
.idea
*.iml
vendor/
composer.lock
/tests/Doctrine/Performance/history.db
/.phpcs-cache
23 changes: 21 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:

- stage: Code Quality
env: DB=none STATIC_ANALYSIS
install: travis_retry composer update --prefer-dist --prefer-stable
install: travis_retry composer install --prefer-dist
before_script:
- echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
Expand All @@ -90,13 +90,32 @@ jobs:
script: php phpbench.phar run -l dots --report=default

- stage: Code Quality
if: NOT type = pull_request
env: DB=none CODING_STANDARDS
php: nightly
php: 7.1
install: travis_retry composer install --prefer-dist
script:
- ./vendor/bin/phpcs

- stage: Code Quality
if: type = pull_request
env: DB=none PULL_REQUEST_CODING_STANDARDS
php: 7.1
install: travis_retry composer install --prefer-dist
script:
- |
if [ $TRAVIS_BRANCH != "master" ]; then
git remote set-branches --add origin $TRAVIS_BRANCH;
git fetch origin $TRAVIS_BRANCH;
fi
- git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow
- wget https://github.com/diff-sniffer/git/releases/download/0.2.0/git-phpcs.phar
- php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA

allow_failures:
- php: nightly
- stage: Code Quality
env: DB=none CODING_STANDARDS

cache:
directories:
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
"symfony/console": "~3.0|~4.0"
},
"require-dev": {
"doctrine/coding-standard": "^1.0",
"doctrine/coding-standard": "^5.0",
"phpunit/phpunit": "^6.5",
"squizlabs/php_codesniffer": "^3.2",
"symfony/yaml": "~3.4|~4.0"
},
"suggest": {
Expand Down
Loading

0 comments on commit 493ff74

Please sign in to comment.