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

Switch to PHPCSStandards/PHP_CodeSniffer #214

Merged
merged 3 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ images provided by [Pipeline-Component][].

[PHPUnit]: https://phpunit.de/
[PHPUnit Polyfills]: https://github.com/Yoast/PHPUnit-Polyfills/
[PHP_CodeSniffer]: https://github.com/squizlabs/PHP_CodeSniffer
[PHP_CodeSniffer]: https://github.com/PHPCSStandards/PHP_CodeSniffer
[PHPCompatibility]: https://github.com/PHPCompatibility/PHPCompatibility
[PHP-Parallel-Lint]: https://github.com/php-parallel-lint/PHP-Parallel-Lint
[PHP-Security-Checker]: https://github.com/fabpot/local-php-security-checker
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ THE SOFTWARE.
[changelog]: https://github.com/PHPCSStandards/composer-installer/releases
[code-of-conduct-shield]: https://img.shields.io/badge/Contributor%20Covenant-v2.0-ff69b4.svg
[code-of-conduct]: CODE_OF_CONDUCT.md
[codesniffer]: https://github.com/squizlabs/PHP_CodeSniffer
[codesniffer]: https://github.com/PHPCSStandards/PHP_CodeSniffer
[composer-manual-scripts]: https://getcomposer.org/doc/articles/scripts.md
[composer-manual-caret]: https://getcomposer.org/doc/articles/versions.md#caret-version-range-
[composer]: https://getcomposer.org/
Expand All @@ -277,7 +277,7 @@ THE SOFTWARE.
[scrutinizer]: https://scrutinizer-ci.com/g/dealerdirect/phpcodesniffer-composer-installer/
[ghactionstest-shield]: https://github.com/PHPCSStandards/composer-installer/actions/workflows/integrationtest.yml/badge.svg
[ghactions]: https://github.com/PHPCSStandards/composer-installer/actions/workflows/integrationtest.yml
[tutorial]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Coding-Standard-Tutorial
[tutorial]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Coding-Standard-Tutorial
[using-composer-plugins]: https://getcomposer.org/doc/articles/plugins.md#using-plugins
[v0.4]: https://github.com/PHPCSStandards/composer-installer/releases/tag/v0.4.0
[v0.7]: https://github.com/PHPCSStandards/composer-installer/releases/tag/v0.7.0
2 changes: 1 addition & 1 deletion tests/IntegrationTest/PreexistingPHPCSConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* the plugin handles this correctly in all supported PHPCS versions.
*
* @link https://github.com/PHPCSStandards/composer-installer/pull/98
* @link https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options
* @link https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options
*/
final class PreexistingPHPCSConfigTest extends TestCase
{
Expand Down
15 changes: 13 additions & 2 deletions tests/PHPCSVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ final class PHPCSVersions
'3.6.2' => '3.6.2',
'3.7.0' => '3.7.0',
'3.7.1' => '3.7.1',
'3.7.2' => '3.7.2',
'3.8.0' => '3.8.0',
);

/**
Expand Down Expand Up @@ -354,10 +356,19 @@ function ($version) {
break;

case '8.3':
$versions = array_filter(
self::$allPhpcsVersions,
function ($version) {
// PHPCS 3.8.0 is the first PHPCS version with runtime support for PHP 8.3.
return version_compare($version, '3.8.0', '>=');
}
);
break;

case '8.4':
/*
* At this point in time, it is unclear as of which PHPCS version PHP 8.3/8.4 will be supported.
* In other words: tests should only use dev-master/4.x when on PHP 8.3/8.4 for the time being.
* At this point in time, it is unclear as of which PHPCS version PHP 8.4 will be supported.
* In other words: tests should only use dev-master/4.x when on PHP 8.4 for the time being.
*/
$versions = array();
break;
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/dummy-src/src/DummySrcSubDir/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="DummySrcSubDir" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="DummySrcSubDir" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

<description>Dummy PHPCS standard for testing.</description>
</ruleset>
2 changes: 1 addition & 1 deletion tests/fixtures/dummy-subdir/DummySubDir/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="DummySubDir" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="DummySubDir" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

<description>Dummy PHPCS standard for testing.</description>
</ruleset>
2 changes: 1 addition & 1 deletion tests/fixtures/incorrect-type/IncorrectType/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="IncorrectType" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="IncorrectType" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

<description>Dummy PHPCS standard for testing.</description>
</ruleset>
2 changes: 1 addition & 1 deletion tests/fixtures/multistandard/My-Third-Standard/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="My-Third-Standard" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="My-Third-Standard" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

<description>Dummy PHPCS standard for testing.</description>
</ruleset>
2 changes: 1 addition & 1 deletion tests/fixtures/multistandard/MyFirstStandard/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="MyFirstStandard" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="MyFirstStandard" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

<description>Dummy PHPCS standard for testing.</description>
</ruleset>
2 changes: 1 addition & 1 deletion tests/fixtures/multistandard/MySecondStandard/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="MySecondStandard" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="MySecondStandard" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

<description>Dummy PHPCS standard for testing.</description>
</ruleset>
2 changes: 1 addition & 1 deletion tests/fixtures/no-ruleset/NoRuleset/ruleset.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="NoRuleset" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="NoRuleset" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">

<description>Dummy PHPCS standard for testing.</description>
</ruleset>