Skip to content

Commit

Permalink
Migrate to phpcsstandards/php_codesniffer
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfodness committed Dec 27, 2023
1 parent 88a55f8 commit d4d29b6
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ To determine where best to report the bug, use the first part of the sniff name:

Sniff name starts with | Report to
--- | ---
`Generic` | [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer/issues/)
`PSR2` | [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer/issues/)
`Squiz` | [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer/issues/)
`Generic` | [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer/issues)
`PSR2` | [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer/issues)
`Squiz` | [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer/issues)
`Universal` | [PHPCSExtra](https://github.com/PHPCSStandards/PHPCSExtra/issues/)
`VariableAnalysis` | [VariableAnalysis](https://github.com/sirbrillig/phpcs-variable-analysis/issues/)
`WordPress` | [WordPressCS](https://github.com/WordPress/WordPress-Coding-Standards/issues/)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/basics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: 'Composer: adjust dependencies'
# Using PHPCS `master` as an early detection system for bugs upstream.
run: composer require --no-update --no-scripts squizlabs/php_codesniffer:"dev-master" --no-interaction
run: composer require --no-update --no-scripts phpcsstandards/php_codesniffer:"dev-master" --no-interaction

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
if: ${{ matrix.php == '5.4' && matrix.dependencies == 'lowest' }}
run: >
composer update --prefer-lowest --no-scripts --no-interaction
squizlabs/php_codesniffer
phpcsstandards/php_codesniffer
phpcsstandards/phpcsutils
phpcsstandards/phpcsextra
sirbrillig/phpcs-variable-analysis
Expand All @@ -83,7 +83,7 @@ jobs:
if: ${{ matrix.php == 'latest' && matrix.dependencies == 'lowest' }}
run: >
composer update --prefer-lowest --no-scripts --no-interaction --ignore-platform-req=php+
squizlabs/php_codesniffer
phpcsstandards/php_codesniffer
phpcsstandards/phpcsutils
phpcsstandards/phpcsextra
sirbrillig/phpcs-variable-analysis
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
if: ${{ matrix.dependencies == 'dev' }}
run: >
composer require --no-update --no-scripts --no-interaction
squizlabs/php_codesniffer:"dev-master"
phpcsstandards/php_codesniffer:"dev-master"
phpcsstandards/phpcsutils:"dev-develop"
phpcsstandards/phpcsextra:"dev-develop"
sirbrillig/phpcs-variable-analysis:"2.x"
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
if: ${{ ! startsWith( matrix.php, '8' ) && matrix.dependencies == 'lowest' }}
run: >
composer update --prefer-lowest --no-scripts --no-interaction
squizlabs/php_codesniffer
phpcsstandards/php_codesniffer
phpcsstandards/phpcsutils
phpcsstandards/phpcsextra
sirbrillig/phpcs-variable-analysis
Expand All @@ -155,7 +155,7 @@ jobs:
if: ${{ startsWith( matrix.php, '8' ) && matrix.dependencies == 'lowest' }}
run: >
composer update --prefer-lowest --no-scripts --no-interaction --ignore-platform-req=php+
squizlabs/php_codesniffer
phpcsstandards/php_codesniffer
phpcsstandards/phpcsutils
phpcsstandards/phpcsextra
sirbrillig/phpcs-variable-analysis
Expand Down
2 changes: 1 addition & 1 deletion .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="VIP Coding Standards" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="VIP Coding Standards" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
<description>The custom ruleset for the VIP Coding Standards itself.</description>

<file>.</file>
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ Included Files
This project includes:

- [WordPress-Coding-Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards), which is Copyright &copy; 2009 John Godley and contributors. Released under the MIT license https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/LICENSE
- [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer), Copyright &copy; 2012, Squiz Pty Ltd (ABN 77 084 670 600). Released under the following license: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt
- [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer), Copyright &copy; 2012, Squiz Pty Ltd (ABN 77 084 670 600). Released under the following license: https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# VIP Coding Standards

This project contains [PHP_CodeSniffer (PHPCS) sniffs and rulesets](https://github.com/squizlabs/PHP_CodeSniffer) to validate code developed for [WordPress VIP](https://wpvip.com/).
This project contains [PHP_CodeSniffer (PHPCS) sniffs and rulesets](https://github.com/PHPCSStandards/PHP_CodeSniffer) to validate code developed for [WordPress VIP](https://wpvip.com/).

This project contains two rulesets:

Expand All @@ -16,7 +16,7 @@ Go to https://docs.wpvip.com/technical-references/code-review/phpcs-report/ to l
## Minimal requirements

* PHP 5.4+
* [PHPCS 3.7.2+](https://github.com/squizlabs/PHP_CodeSniffer/releases)
* [PHPCS 3.8.0+](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases)
* [PHPCSUtils 1.0.8+](https://github.com/PHPCSStandards/PHPCSUtils)
* [WPCS 3.0.0+](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/releases)
* [VariableAnalysis 2.11.17+](https://github.com/sirbrillig/phpcs-variable-analysis/releases)
Expand Down
2 changes: 1 addition & 1 deletion WordPress-VIP-Go/ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPress-VIP-Go" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPress-VIP-Go" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
<description>WordPress VIP Go Coding Standards</description>

<!-- The rules below are the changes from between the original sniff or parent ruleset, and what should be applied for this Standard. -->
Expand Down
2 changes: 1 addition & 1 deletion WordPressVIPMinimum/ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPressVIPMinimum" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPressVIPMinimum" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
<description>WordPress VIP Minimum Coding Standards</description>

<!--
Expand Down
4 changes: 2 additions & 2 deletions bin/unit-tests
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

if [[ $(php -r 'echo PHP_VERSION_ID;') -ge 80100 ]]; then
"$(pwd)/vendor/bin/phpunit" --filter=WordPressVIPMinimum "$(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php" --no-coverage --no-configuration --bootstrap=./tests/bootstrap.php --dont-report-useless-tests $@
"$(pwd)/vendor/bin/phpunit" --filter=WordPressVIPMinimum "$(pwd)/vendor/phpcsstandards/php_codesniffer/tests/AllTests.php" --no-coverage --no-configuration --bootstrap=./tests/bootstrap.php --dont-report-useless-tests $@
else
"$(pwd)/vendor/bin/phpunit" --filter=WordPressVIPMinimum "$(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php" --no-coverage $@
"$(pwd)/vendor/bin/phpunit" --filter=WordPressVIPMinimum "$(pwd)/vendor/phpcsstandards/php_codesniffer/tests/AllTests.php" --no-coverage $@
fi
2 changes: 1 addition & 1 deletion bin/unit-tests-coverage
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
# ./bin/unit-tests-coverage --filter SniffName
#

"$(pwd)/vendor/bin/phpunit" --filter WordPressVIPMinimum "$(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php" $@
"$(pwd)/vendor/bin/phpunit" --filter WordPressVIPMinimum "$(pwd)/vendor/phpcsstandards/php_codesniffer/tests/AllTests.php" $@
2 changes: 1 addition & 1 deletion bin/xml-lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# ./bin/xml-lint

# Validate the ruleset XML files.
xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd ./*/ruleset.xml
xmllint --noout --schema ./vendor/phpcsstandards/php_codesniffer/phpcs.xsd ./*/ruleset.xml

# Check the code-style consistency of the XML files.
export XMLLINT_INDENT=" " # This is a tab character.
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
],
"require": {
"php": ">=5.4",
"phpcsstandards/php_codesniffer": "^3.8.0",
"phpcsstandards/phpcsextra": "^1.1.0",
"phpcsstandards/phpcsutils": "^1.0.8",
"sirbrillig/phpcs-variable-analysis": "^2.11.17",
"squizlabs/php_codesniffer": "^3.7.2",
"wp-coding-standards/wpcs": "^3.0"
},
"require-dev": {
Expand All @@ -41,7 +41,7 @@
"bin/php-lint",
"bin/xml-lint"
],
"cs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs",
"cs": "@php ./vendor/phpcsstandards/php_codesniffer/bin/phpcs",
"test": "bin/unit-tests",
"test-coverage": "bin/unit-tests-coverage",
"feature-completeness": [
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

// Get the PHPCS dir from an environment variable.
$phpcsDir = getenv( 'PHPCS_DIR' );
$composerPHPCSPath = dirname( __DIR__ ) . $ds . 'vendor' . $ds . 'squizlabs' . $ds . 'php_codesniffer';
$composerPHPCSPath = dirname( __DIR__ ) . $ds . 'vendor' . $ds . 'phpcsstandards' . $ds . 'php_codesniffer';

// This may be a Composer install.
if ( $phpcsDir === false && is_dir( $composerPHPCSPath ) ) {
Expand Down

0 comments on commit d4d29b6

Please sign in to comment.