diff --git a/.travis.yml b/.travis.yml index affe683..f8be8d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ cache: # Cache directory for more recent Composer versions. - $HOME/.cache/composer/files +# Note: PHP 7.3, 7.4 and nightly are added via "jobs". php: - 5.4 - 5.5 @@ -20,7 +21,7 @@ php: - 7.2 env: - # `master` + # PHPCS `master` - PHPCS_VERSION="dev-master" LINT=1 # Lowest supported PHPCS version. - PHPCS_VERSION="3.0.2" @@ -33,16 +34,16 @@ env: stages: - name: sniff - name: quicktest - if: type = push AND branch NOT IN (master, develop) + if: type = push AND branch NOT IN (stable, develop) - name: test - if: branch IN (master, develop) + if: branch IN (stable, develop) jobs: fast_finish: true include: #### SNIFF STAGE #### - stage: sniff - php: 7.3 + php: 7.4 env: PHPCS_VERSION="dev-master" addons: apt: @@ -67,7 +68,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_VERSION="dev-master" LINT=1 - stage: quicktest php: 7.2 @@ -93,12 +94,18 @@ jobs: # PHPCS is only compatible with PHP 7.4 as of version 3.5.0. - php: 7.4 env: PHPCS_VERSION="3.5.0" + + # Builds against unstable versions which are allowed to fail for now. + - stage: test + php: 7.4 + env: PHPCS_VERSION="4.0.x-dev" - php: "nightly" - env: PHPCS_VERSION="n/a" LINT=1 + env: PHPCS_VERSION="dev-master" LINT=1 allow_failures: # Allow failures for unstable builds. - php: "nightly" + - env: PHPCS_VERSION="4.0.x-dev" before_install: @@ -108,7 +115,7 @@ 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_VERSION" != "dev-master" && "$PHPCS_VERSION" != "n/a" ]]; then + if [[ "${TRAVIS_BUILD_STAGE_NAME^}" != "Sniff" && "$PHPCS_VERSION" != "dev-master" && "$PHPCS_VERSION" != "4.0.x-dev" ]]; then echo 'error_reporting = E_ALL & ~E_DEPRECATED' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini fi @@ -116,7 +123,7 @@ before_install: # Set up test environment using Composer. - | - if [[ "$TRAVIS_BUILD_STAGE_NAME" != "Sniff" ]]; then + if [[ "${TRAVIS_BUILD_STAGE_NAME^}" != "Sniff" ]]; then # Remove the PHPCSDevCS dependency as it has different PHPCS requirements and would block installs. composer remove --dev phpcsstandards/phpcsdevcs --no-update --no-scripts fi @@ -125,7 +132,7 @@ before_install: composer require --no-update --no-scripts squizlabs/php_codesniffer:${PHPCS_VERSION} fi - | - if [[ "$TRAVIS_BUILD_STAGE_NAME" == "Sniff" || $PHPCS_VERSION == "n/a" ]]; then + if [[ "${TRAVIS_BUILD_STAGE_NAME^}" == "Sniff" ]]; then # The sniff stage doesn't run the unit tests, so no need for PHPUnit. composer remove --dev phpunit/phpunit --no-update --no-scripts elif [[ "$PHPCS_VERSION" < "3.1.0" ]]; then @@ -138,7 +145,16 @@ before_install: # --prefer-dist will allow for optimal use of the travis caching ability. # The Composer PHPCS plugin takes care of setting the installed_paths for PHPCS. - - composer install --prefer-dist --no-suggest + - | + if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then + # Not all dependencies allow for installing on nightly yet, so ignore platform requirements. + composer install --prefer-dist --no-suggest --ignore-platform-reqs + elif [[ "$PHPCS_VERSION" == "4.0.x-dev" ]]; then + # PHPCS 4.x does not ship by default with the base test case, so source is needed. + composer install --prefer-source --no-suggest + else + composer install --prefer-dist --no-suggest + fi script: diff --git a/CHANGELOG.md b/CHANGELOG.md index 2063917..707b6a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses _Nothing yet._ +## [1.0.1] - 2020-06-28 + +### Changed +* The `master` branch has been renamed to `stable`. +* The version requirements for the [Dealerdirect Composer PHPCS plugin] have been widened to allow installation of releases from the `0.7.x` range, which brings compatibility with Composer 2.0. +* Miscellaneous updates to the development environment and CI scripts. + + ## 1.0.0 - 2020-02-12 Initial release containing: @@ -17,5 +25,7 @@ Initial release containing: * A `PHPCSDebug` standard to help debugging sniffs. -[Unreleased]: https://github.com/PHPCSStandards/PHPCSDevTools/compare/1.0.0...HEAD +[Unreleased]: https://github.com/PHPCSStandards/PHPCSDevTools/compare/master...HEAD +[1.0.1]: https://github.com/PHPCSStandards/PHPCSDevTools/compare/1.0.0...1.0.1 +[Dealerdirect Composer PHPCS plugin]: https://github.com/Dealerdirect/phpcodesniffer-composer-installer/ diff --git a/README.md b/README.md index c74d118..fcd1831 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ PHPCSDevTools for developers of PHP_CodeSniffer sniffs ===================================================== [![Latest Stable Version](https://poser.pugx.org/phpcsstandards/phpcsdevtools/v/stable)](https://packagist.org/packages/phpcsstandards/phpcsdevtools) -[![Travis Build Status](https://travis-ci.com/PHPCSStandards/PHPCSDevTools.svg?branch=master)](https://travis-ci.com/PHPCSStandards/PHPCSDevTools/branches) +[![Travis Build Status](https://travis-ci.com/PHPCSStandards/PHPCSDevTools.svg?branch=stable)](https://travis-ci.com/PHPCSStandards/PHPCSDevTools/branches) [![Release Date of the Latest Version](https://img.shields.io/github/release-date/PHPCSStandards/PHPCSDevTools.svg?maxAge=1800)](https://github.com/PHPCSStandards/PHPCSDevTools/releases) :construction: [![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)](https://packagist.org/packages/phpcsstandards/phpcsdevtools#dev-develop) @@ -12,7 +12,7 @@ PHPCSDevTools for developers of PHP_CodeSniffer sniffs [![Minimum PHP Version](https://img.shields.io/packagist/php-v/phpcsstandards/phpcsdevtools.svg?maxAge=3600)](https://packagist.org/packages/phpcsstandards/phpcsdevtools) [![Tested on PHP 5.4 to nightly](https://img.shields.io/badge/tested%20on-PHP%205.4%20|%205.5%20|%205.6%20|%207.0%20|%207.1%20|%207.2%20|%207.3%20|%207.4%20|%20nightly-brightgreen.svg?maxAge=2419200)](https://travis-ci.com/PHPCSStandards/PHPCSDevTools) -[![License: LGPLv3](https://poser.pugx.org/phpcsstandards/phpcsdevtools/license)](https://github.com/PHPCSStandards/PHPCSDevTools/blob/master/LICENSE) +[![License: LGPLv3](https://poser.pugx.org/phpcsstandards/phpcsdevtools/license)](https://github.com/PHPCSStandards/PHPCSDevTools/blob/stable/LICENSE) ![Awesome](https://img.shields.io/badge/awesome%3F-yes!-brightgreen.svg) @@ -43,7 +43,7 @@ composer require --dev phpcsstandards/phpcsdevtools:^1.0 If you work on several different sniff repos, you may want to install this toolset globally: ```bash -composer global require phpcsstandards/phpcsdevtools:^1.0 +composer global require --dev phpcsstandards/phpcsdevtools:^1.0 ``` Composer will automatically install dependencies and register the PHPCSDebug standard with PHP_CodeSniffer using the [DealerDirect Composer PHPCS plugin](https://github.com/Dealerdirect/phpcodesniffer-composer-installer/). @@ -59,7 +59,7 @@ Composer will automatically install dependencies and register the PHPCSDebug sta ```bash phpcs --config-set installed_paths /path/to/PHPCSDevTools ``` - **Warning**: :warning: The `installed_paths` command overwrites any previously set `installed_paths`. If you have previously set `installed_paths` for other external standards, run `phpcs --config-show` first and then run the `installed_paths` command with all the paths you need separated by comma's, i.e.: + :warning: **Warning**: The `installed_paths` command overwrites any previously set `installed_paths`. If you have previously set `installed_paths` for other external standards, run `phpcs --config-show` first and then run the `installed_paths` command with all the paths you need separated by comma's, i.e.: ```bash phpcs --config-set installed_paths /path/1,/path/2,/path/3 ``` @@ -70,9 +70,9 @@ Features ### Checking whether all sniffs in a PHPCS standard are feature complete -You can now easily check whether each and every sniff in your standard is accompanied by a documentation XML file (warning) as well as unit test files (error). +You can now check whether each and every sniff in your standard is accompanied by a documentation XML file (warning) as well as unit test files (error). -To use the tool, run it from the root of the your standards repo like so: +To use the tool, run it from the root of your standards repo like so: ```bash # When installed as a project dependency: vendor/bin/phpcs-check-feature-completeness @@ -122,7 +122,7 @@ Once this project is installed, you will see a new `PHPCSDebug` ruleset in the l For now, this standard only contains one sniff: `PHPCSDebug.Debug.TokenList`. This sniff will display compact, but detailed information about the tokens found in a (test case) file. -This sniff is compatible with PHPCS 3.0+. +This sniff is compatible with PHPCS 3.0.2+. Typical usage: * Set up a test case file for a new sniff you intend to write. @@ -172,7 +172,7 @@ PHPCS itself can also display similar information using the `-vv` or `-vvv` verb Contributing ------- -Contributions to this project are welcome. Just clone the repo, branch off from `develop`, make your changes, commit them and send in a pull request. +Contributions to this project are welcome. Clone this repository, branch off from `develop`, make your changes, commit them and send in a pull request. If unsure whether the changes you are proposing would be welcome, open an issue first to discuss your proposal. diff --git a/VERSION b/VERSION index afaf360..7f20734 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.0.1 \ No newline at end of file diff --git a/composer.json b/composer.json index 39380f6..e8abe93 100644 --- a/composer.json +++ b/composer.json @@ -22,21 +22,21 @@ "require" : { "php" : ">=5.4", "squizlabs/php_codesniffer" : "^3.0.2", - "dealerdirect/phpcodesniffer-composer-installer" : "^0.3 || ^0.4.1 || ^0.5 || ^0.6.2" + "dealerdirect/phpcodesniffer-composer-installer" : "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7" }, "require-dev" : { "roave/security-advisories" : "dev-master", "phpunit/phpunit" : "^4.5 || ^5.0 || ^6.0 || ^7.0", - "jakub-onderka/php-parallel-lint": "^1.0", - "jakub-onderka/php-console-highlighter": "^0.4", - "phpcsstandards/phpcsdevcs": "^1.0.0" + "php-parallel-lint/php-parallel-lint": "^1.0", + "php-parallel-lint/php-console-highlighter": "^0.5", + "phpcsstandards/phpcsdevcs": "^1.0" }, "bin": [ "bin/phpcs-check-feature-completeness" ], "scripts" : { "lint": [ - "@php ./vendor/jakub-onderka/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git" + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git" ], "check-cs": [ "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs" diff --git a/phpunit-bootstrap.php b/phpunit-bootstrap.php index b15395e..9689d19 100644 --- a/phpunit-bootstrap.php +++ b/phpunit-bootstrap.php @@ -79,5 +79,4 @@ \putenv("PHPCS_IGNORE_TESTS={$standardsToIgnoreString}"); // Clean up. -unset($ds, $phpcsDir, $composerPHPCSPath); unset($ds, $phpcsDir, $composerPHPCSPath, $allStandards, $standardsToIgnore, $standard, $standardsToIgnoreString);