diff --git a/.travis.yml b/.travis.yml index bbd5417579..4369ad0926 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ jobs: include: #### SNIFF STAGE #### - stage: sniff - php: 7.3 + php: 7.4 env: PHPCS_BRANCH="dev-master" addons: apt: @@ -70,12 +70,21 @@ jobs: - diff -B --tabsize=4 ./WordPress-Extra/ruleset.xml <(xmllint --format "./WordPress-Extra/ruleset.xml") - diff -B --tabsize=4 ./phpcs.xml.dist.sample <(xmllint --format "./phpcs.xml.dist.sample") + # Validate the composer.json file. + # @link https://getcomposer.org/doc/03-cli.md#validate + - composer validate --no-check-all --strict + + # Check that the sniffs available are feature complete. + # For now, just check that all sniffs have unit tests. + # At a later stage the documentation check can be activated. + - composer check-complete + #### RULESET STAGE #### # Make sure the rulesets don't throw unexpected errors or warnings. # This check needs to be run against a high PHP version to prevent triggering the syntax error check. # It also needs to be run against all PHPCS versions WPCS is tested against. - stage: rulesets - php: 7.3 + php: 7.4 env: PHPCS_BRANCH="dev-master" script: - $(pwd)/vendor/bin/phpcs -ps ./bin/class-ruleset-test.php --standard=WordPress-Core @@ -91,7 +100,7 @@ jobs: - travis_retry $(pwd)/vendor/bin/phpcbf -pq ./WordPress/Tests/ --standard=WordPress --extensions=inc --exclude=Generic.PHP.Syntax --report=summary - stage: rulesets - php: 7.3 + php: 7.4 env: PHPCS_BRANCH="3.3.1" script: - $(pwd)/vendor/bin/phpcs -ps ./bin/class-ruleset-test.php --standard=WordPress-Core @@ -103,7 +112,7 @@ jobs: # This is a much quicker test which only runs the unit tests and linting against the low/high # supported PHP/PHPCS combinations. - stage: quicktest - php: 7.3 + php: 7.4 env: PHPCS_BRANCH="dev-master" LINT=1 - php: 7.3 env: PHPCS_BRANCH="3.3.1" @@ -112,9 +121,16 @@ jobs: - php: 5.4 env: PHPCS_BRANCH="3.3.1" + #### TEST STAGE #### + # Add extra build to test against PHPCS 4. + - stage: test + php: 7.4 + env: PHPCS_BRANCH="4.0.x-dev" + allow_failures: # Allow failures for unstable builds. - php: "nightly" + - env: PHPCS_BRANCH="4.0.x-dev" before_install: # Speed up build time by disabling Xdebug. @@ -125,15 +141,22 @@ before_install: # On stable PHPCS versions, allow for PHP deprecation notices. # Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore. - | - if [[ "$TRAVIS_BUILD_STAGE_NAME" != "Sniff" && $PHPCS_BRANCH != "dev-master" ]]; then + if [[ "${TRAVIS_BUILD_STAGE_NAME^}" != "Sniff" && $PHPCS_BRANCH != "dev-master" ]]; then echo 'error_reporting = E_ALL & ~E_DEPRECATED' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini fi - export XMLLINT_INDENT=" " - export PHPUNIT_DIR=/tmp/phpunit + - | + if [[ $TRAVIS_PHP_VERSION == "nightly" || $PHPCS_BRANCH == "4.0.x-dev" ]]; then + # Even though we're not doing a dev install, dev requirements are still checked. + # Neither the PHPCS Composer plugin nor PHPCompatibility allows yet for PHPCS 4.x. + # The Composer plugin also doesn't allow for installation on PHP 8.x/nightly. + composer remove --dev dealerdirect/phpcodesniffer-composer-installer phpcompatibility/php-compatibility --no-update --no-scripts + fi - composer require squizlabs/php_codesniffer:${PHPCS_BRANCH} --update-no-dev --no-suggest --no-scripts - | - if [[ "$TRAVIS_BUILD_STAGE_NAME" == "Sniff" ]]; then + if [[ "${TRAVIS_BUILD_STAGE_NAME^}" == "Sniff" ]]; then composer install --dev --no-suggest # The `dev` required DealerDirect Composer plugin takes care of the installed_paths. else @@ -148,10 +171,6 @@ script: # Lint the PHP files against parse errors. - if [[ "$LINT" == "1" ]]; then if find . -path ./vendor -prune -o -path ./bin -prune -o -name "*.php" -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi; fi - # Validate the composer.json file. - # @link https://getcomposer.org/doc/03-cli.md#validate - - if [[ "$LINT" == "1" ]]; then composer validate --no-check-all --strict; fi - # Run the unit tests. - | if [[ ${TRAVIS_PHP_VERSION:0:3} > "7.1" ]]; then diff --git a/CHANGELOG.md b/CHANGELOG.md index 072f0ac71d..f8c8c98784 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,24 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a _No documentation available about unreleased changes as of yet._ +## [2.3.0] - 2020-05-14 + +### Added +- The `WordPress.WP.I18n` sniff contains a new check for translatable text strings which are wrapped in HTML tags, like `