Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release PHPCSExtra 1.2.1 #301

Merged
merged 7 commits into from Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/basics.yml
Expand Up @@ -42,8 +42,6 @@ jobs:

- name: 'Composer: adjust dependencies'
run: |
# The sniff stage doesn't run the unit tests, so no need for PHPUnit.
composer remove --no-update --dev phpunit/phpunit --no-scripts --no-interaction
# Using PHPCS `master` as an early detection system for bugs upstream.
composer require --no-update squizlabs/php_codesniffer:"dev-master" --no-interaction

Expand Down Expand Up @@ -107,7 +105,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: 'latest'
coverage: none
tools: phpstan

Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/quicktest.yml
Expand Up @@ -61,21 +61,12 @@ jobs:

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies - normal
if: matrix.php != 'latest'
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

# For PHP "latest", we need to install with ignore platform reqs as not all PHPUnit 7.x dependencies allow it.
- name: Install Composer dependencies - with ignore platform
if: matrix.php == 'latest'
uses: "ramsey/composer-install@v2"
with:
composer-options: --ignore-platform-req=php+
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: >
Expand All @@ -86,10 +77,5 @@ jobs:
if: matrix.phpcs_version == 'dev-master'
run: composer lint

- name: Run the unit tests - PHP 5.4 - 8.0
if: matrix.php != 'latest'
- name: Run the unit tests
run: composer test

- name: Run the unit tests - PHP > 8.1
if: matrix.php == 'latest'
run: composer test -- --no-configuration --bootstrap=phpunit-bootstrap.php --dont-report-useless-tests
23 changes: 4 additions & 19 deletions .github/workflows/test.yml
Expand Up @@ -32,7 +32,7 @@ jobs:
# @link https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix
#
# The matrix is set up so as not to duplicate the builds which are run for code coverage.
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '8.0', '8.1', '8.2', '8.3', '8.4']
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.4']
phpcs_version: ['lowest', 'dev-master']

name: "Test${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
Expand Down Expand Up @@ -67,21 +67,12 @@ jobs:

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies - normal
if: ${{ startsWith( matrix.php, '8' ) == false }}
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

# For the PHP 8/"nightly", we need to install with ignore platform reqs as we're still using PHPUnit 7.
- name: Install Composer dependencies - with ignore platform
if: ${{ startsWith( matrix.php, '8' ) }}
uses: "ramsey/composer-install@v2"
with:
composer-options: --ignore-platform-req=php+
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: >
Expand All @@ -92,14 +83,9 @@ jobs:
if: matrix.phpcs_version == 'dev-master'
run: composer lint

- name: Run the unit tests - PHP 5.4 - 8.0
if: ${{ matrix.php < '8.1' }}
- name: Run the unit tests
run: composer test

- name: Run the unit tests - PHP > 8.1
if: ${{ matrix.php >= '8.1' }}
run: composer test -- --no-configuration --bootstrap=phpunit-bootstrap.php --dont-report-useless-tests

#### CODE COVERAGE STAGE ####
# N.B.: Coverage is only checked on the lowest and highest stable PHP versions
# and a low/high of each major for PHPCS.
Expand All @@ -114,8 +100,7 @@ jobs:

strategy:
matrix:
# 7.4 should be updated to 8.2 when higher PHPUnit versions can be supported.
php: ['5.4', '7.4']
php: ['5.4', '8.3']
phpcs_version: ['lowest', 'dev-master']

name: "Coverage${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
Expand Down
17 changes: 16 additions & 1 deletion CHANGELOG.md
Expand Up @@ -14,6 +14,20 @@ This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses

_Nothing yet._

## [1.2.1] - 2023-12-08

### Changed

#### Other

* Composer: The minimum `PHP_CodeSniffer` requirement has been updated to `^3.8.0` (was `^3.7.2`). [#298]
* Composer: The minimum `PHPCSUtils` requirement has been updated to `^1.0.9` (was `^1.0.8`). [#298]

Please ensure you run `composer update phpcsstandards/phpcsextra --with-dependencies` to benefit from this.

[#298]: https://github.com/PHPCSStandards/PHPCSExtra/pull/298


## [1.2.0] - 2023-12-02

### Added
Expand Down Expand Up @@ -550,9 +564,10 @@ This initial alpha release contains the following sniffs:
Individual sub-types can be allowed by excluding specific error codes.

[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer
[php_version-config]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
[php_version-config]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version

[Unreleased]: https://github.com/PHPCSStandards/PHPCSExtra/compare/stable...HEAD
[1.2.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.2...1.2.0
[1.1.2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.1...1.1.2
[1.1.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.0...1.1.1
Expand Down
2 changes: 1 addition & 1 deletion Modernize/ruleset.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Modernize" namespace="PHPCSExtra\Modernize" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Modernize" namespace="PHPCSExtra\Modernize" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

<description>A collection of sniffs to detect code modernization opportunities.</description>
</ruleset>
2 changes: 1 addition & 1 deletion NormalizedArrays/ruleset.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="NormalizedArrays" namespace="PHPCSExtra\NormalizedArrays" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="NormalizedArrays" namespace="PHPCSExtra\NormalizedArrays" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

<description>A ruleset for PHP_CodeSniffer to check arrays for normalized format.</description>
</ruleset>
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -46,8 +46,8 @@ Minimum Requirements
-------------------------------------------

* PHP 5.4 or higher.
* [PHP_CodeSniffer][phpcs-gh] version **3.7.1** or higher.
* [PHPCSUtils][phpcsutils-gh] version **1.0.8** or higher.
* [PHP_CodeSniffer][phpcs-gh] version **3.8.0** or higher.
* [PHPCSUtils][phpcsutils-gh] version **1.0.9** or higher.


Installation
Expand Down Expand Up @@ -566,8 +566,8 @@ This code is released under the [GNU Lesser General Public License (LGPLv3)](LIC
[gha-qa-results]: https://github.com/PHPCSStandards/PHPCSExtra/actions/workflows/basics.yml
[gha-test-results]: https://github.com/PHPCSStandards/PHPCSExtra/actions/workflows/test.yml

[phpcs-gh]: https://github.com/squizlabs/PHP_CodeSniffer
[phpcs-gh]: https://github.com/PHPCSStandards/PHP_CodeSniffer
[phpcsutils-gh]: https://github.com/PHPCSStandards/PHPCSUtils
[composer-installer-gh]: https://github.com/PHPCSStandards/composer-installer

[php_version-config]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
[php_version-config]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
2 changes: 1 addition & 1 deletion Universal/ruleset.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Universal" namespace="PHPCSExtra\Universal" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Universal" namespace="PHPCSExtra\Universal" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

<description>A collection of universal sniffs. This standard is not designed to be used to check code. Include individual sniffs from this standard in a custom ruleset instead.</description>
</ruleset>
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -22,15 +22,15 @@
},
"require" : {
"php" : ">=5.4",
"squizlabs/php_codesniffer" : "^3.7.1",
"phpcsstandards/phpcsutils" : "^1.0.8"
"squizlabs/php_codesniffer" : "^3.8.0",
"phpcsstandards/phpcsutils" : "^1.0.9"
},
"require-dev" : {
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"php-parallel-lint/php-console-highlighter": "^1.0",
"phpcsstandards/phpcsdevcs": "^1.1.6",
"phpcsstandards/phpcsdevtools": "^1.2.1",
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0"
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
},
"extra": {
"branch-alias": {
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Expand Up @@ -5,7 +5,7 @@
<!--
#############################################################################
COMMAND LINE ARGUMENTS
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
#############################################################################
-->

Expand Down