Skip to content

Commit

Permalink
Merge pull request #44 from PHPCSStandards/develop
Browse files Browse the repository at this point in the history
Release version 1.0.1
  • Loading branch information
jrfnl authored Jun 28, 2020
2 parents 0f0776e + 29c4bcf commit 5cb7f67
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 26 deletions.
36 changes: 26 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -108,15 +115,15 @@ 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
- export XMLLINT_INDENT=" "

# 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
Expand All @@ -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
Expand All @@ -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:
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ 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:
* Feature completeness checking tool for PHPCS sniffs.
* 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/
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)


Expand Down Expand Up @@ -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/).
Expand All @@ -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
```
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion phpunit-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@
\putenv("PHPCS_IGNORE_TESTS={$standardsToIgnoreString}");

// Clean up.
unset($ds, $phpcsDir, $composerPHPCSPath);
unset($ds, $phpcsDir, $composerPHPCSPath, $allStandards, $standardsToIgnore, $standard, $standardsToIgnoreString);

0 comments on commit 5cb7f67

Please sign in to comment.