From ee4c391682d1af74e573a50576ed3d8c11e93125 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 6 Nov 2020 13:11:01 +1300 Subject: [PATCH 1/2] MNT Update how phpcs is called --- .travis.yml | 2 +- composer.json | 4 ---- phpcs.xml.dist | 4 +++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d1eed1d2..4df87576 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ before_script: script: - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests; fi - if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml tests; fi - - if [[ $PHPCS_TEST ]]; then composer run-script lint; fi + - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs; fi after_success: - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi diff --git a/composer.json b/composer.json index 93a963a3..6539b889 100644 --- a/composer.json +++ b/composer.json @@ -41,10 +41,6 @@ "SilverStripe\\Reports\\Tests\\": "tests/" } }, - "scripts": { - "lint": "phpcs code/ tests/", - "lint-clean": "phpcbf code/ tests/" - }, "minimum-stability": "dev", "prefer-stable": true } diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 9276cd5a..ddad7d2b 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -2,6 +2,9 @@ CodeSniffer ruleset for SilverStripe coding conventions. + code + tests + @@ -19,4 +22,3 @@ - From da8bc5c240b71bda86edb31f71613dc08c0ffa48 Mon Sep 17 00:00:00 2001 From: Serge Latyntcev Date: Fri, 6 Nov 2020 17:20:57 +1300 Subject: [PATCH 2/2] MNT Travis shared config --- .travis.yml | 52 +++++---------------------------------------------- composer.json | 3 ++- 2 files changed, 7 insertions(+), 48 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4df87576..eee4dafa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,51 +1,9 @@ -language: php +version: ~> 1.0 -dist: xenial - -services: - - mysql - - postgresql - -cache: - directories: - - $HOME/.composer/cache/files +import: + - silverstripe/silverstripe-travis-shared:config/provision/standard-jobs-fixed.yml env: global: - - COMPOSER_ROOT_VERSION=4.x-dev - -matrix: - fast_finish: true - include: - - php: 7.1 - env: DB=MYSQL PHPUNIT_TEST=1 COMPOSER_ARG=--prefer-lowest - - php: 7.2 - env: DB=MYSQL PHPUNIT_TEST=1 PHPCS_TEST=1 - - php: 7.3 - env: DB=MYSQL RECIPE_VERSION=4.6.x-dev PHPUNIT_TEST=1 - - php: 7.4 - env: DB=MYSQL PHPUNIT_TEST=1 - - php: nightly - env: PHPUNIT_TEST=1 COMPOSER_ARG=--ignore-platform-reqs - -before_script: -# Init PHP - - phpenv rehash - - phpenv config-rm xdebug.ini || true - -# Install composer dependencies - - export PATH=~/.composer/vendor/bin:$PATH - - composer validate - - if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:2.x-dev --no-update; fi - - if [[ $DB == SQLITE ]]; then composer require silverstripe/sqlite3:2.x-dev --no-update; fi - - composer require silverstripe/recipe-core:4.x-dev silverstripe/admin:1.x-dev silverstripe/versioned:1.x-dev --no-update - - if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi - - composer update --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile $COMPOSER_ARG - -script: - - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests; fi - - if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml tests; fi - - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs; fi - -after_success: - - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi + - COMPOSER_ROOT_VERSION="4.7.x-dev" + - REQUIRE_RECIPE="$COMPOSER_ROOT_VERSION" diff --git a/composer.json b/composer.json index 6539b889..545972f0 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ "silverstripe/vendor-plugin": "^1" }, "require-dev": { - "sminnee/phpunit": "^5.7" + "sminnee/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.0" }, "extra": { "expose": [