From 2168b8ec4a995b0065f128ebcdb38a00db006444 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Mon, 12 Feb 2024 18:23:21 +0100 Subject: [PATCH] [TASK] Drop PHP_CodeSniffer This tool is not well-maintained anymore, and it has no PER2 coding standard, which is a blocker for us moving to PER2. PHP-CS-Fixer already has a PER2 coding standard. If we use PHP-CS-Fixer on PER2 and PHP_CodeSniffer on PSR12 (the latest available standard there), both tools would keep overwriting each other's changes endlessly, and they would never agree on the correct formatting. --- .github/workflows/ci.yml | 3 +-- .phive/phars.xml | 2 -- composer.json | 8 +------- config/phpcs.xml | 17 ----------------- 4 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 config/phpcs.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ffea44c..2bdb67c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,6 @@ jobs: fail-fast: false matrix: command: - - sniffer - fixer - stan php-version: @@ -120,7 +119,7 @@ jobs: - name: Install development tools run: | - phive --no-progress install --trust-gpg-keys BBAB5DF0A0D6672989CF1869E82B2FB314E9906E,95DE904AB800754A11D80B605E6DDE998AB73B8E + phive --no-progress install --trust-gpg-keys BBAB5DF0A0D6672989CF1869E82B2FB314E9906E - name: Run Command run: composer ci:php:${{ matrix.command }} diff --git a/.phive/phars.xml b/.phive/phars.xml index 52fc28a2..3d509be9 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,6 +1,4 @@ - - diff --git a/composer.json b/composer.json index aecc41dd..a8e4d70d 100644 --- a/composer.json +++ b/composer.json @@ -65,30 +65,24 @@ "@ci:static" ], "ci:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots bin src tests", - "ci:php:sniffer": "@php ./.phive/phpcs.phar --standard=config/phpcs.xml bin src tests", "ci:php:stan": "phpstan --no-progress --configuration=config/phpstan.neon", "ci:static": [ "@ci:php:fixer", - "@ci:php:sniffer", "@ci:php:stan" ], "fix:php": [ - "@fix:php:fixer", - "@fix:php:sniffer" + "@fix:php:fixer" ], "fix:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix bin src tests", - "fix:php:sniffer": "@php ./.phive/phpcbf.phar --standard=config/phpcs.xml bin src tests", "phpstan:baseline": "phpstan --configuration=config/phpstan.neon --generate-baseline=config/phpstan-baseline.neon" }, "scripts-descriptions": { "ci": "Runs all dynamic and static code checks (i.e. currently, only the static checks).", "ci:php:fixer": "Checks the code style with PHP CS Fixer.", - "ci:php:sniffer": "Checks the code style with PHP_CodeSniffer.", "ci:php:stan": "Checks the types with PHPStan.", "ci:static": "Runs all static code analysis checks for the code.", "fix:php": "Autofixes all autofixable issues in the PHP code.", "fix:php:fixer": "Fixes autofixable issues found by PHP CS Fixer.", - "fix:php:sniffer": "Fixes autofixable issues found by PHP_CodeSniffer.", "phpstand:baseline": "Updates the PHPStan baseline file to match the code." } } diff --git a/config/phpcs.xml b/config/phpcs.xml deleted file mode 100644 index 14473bb2..00000000 --- a/config/phpcs.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - This standard requires PHP_CodeSniffer >= 3.6.0. - - - - - - - - - - - - -