From f7f2763c0ca6bf758772d3ad9476b310cea60a92 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Mon, 27 Jan 2025 12:24:35 +0100 Subject: [PATCH] [TASK] Drop the PHIVE-installed development tools It has turned out that our current set of PHIVE-installed development tools for the V8.x maintenance branch is no longer installable due to issues with the GPG keys used for signing the PHARs. As the maintenance branch has very little activity anyway now, relying on PHP linting and the unit tests should suffice, saving us the hassle with PHIVE on that branch. (We're still keeping some `.gitignore` entries related to the tools to make switching branches easier.) Closes #831 Closes #830 --- .github/workflows/ci.yml | 52 ------------------------------------ .phive/phars.xml | 7 ----- composer.json | 31 --------------------- config/php-cs-fixer.php | 34 ----------------------- config/phpcs.xml | 17 ------------ config/phpstan-baseline.neon | 12 --------- config/phpstan.neon | 18 ------------- 7 files changed, 171 deletions(-) delete mode 100644 .phive/phars.xml delete mode 100644 config/php-cs-fixer.php delete mode 100644 config/phpcs.xml delete mode 100644 config/phpstan-baseline.neon delete mode 100644 config/phpstan.neon diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 815ccb43..865d202d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,55 +73,3 @@ jobs: - name: Run Tests run: ./vendor/bin/phpunit - - static-analysis: - name: Static Analysis - - runs-on: ubuntu-22.04 - - needs: [ php-lint ] - - strategy: - fail-fast: false - matrix: - include: - - command: sniffer - php-version: '7.4' - - command: fixer - php-version: '7.4' - - command: stan - php-version: '7.4' - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - tools: "composer:v2, phive" - coverage: none - - - name: Show the Composer configuration - run: composer config --global --list - - - name: Cache dependencies installed with composer - uses: actions/cache@v4 - with: - path: ~/.cache/composer - key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: | - php${{ matrix.php-version }}-composer- - - - name: Install Composer dependencies - run: | - composer update --with-dependencies --no-progress; - composer show; - - - name: Install development tools - run: | - phive --no-progress install --trust-gpg-keys 0FDE18AE1D09E19F60F6B1CBC00543248C87FB13,BBAB5DF0A0D6672989CF1869E82B2FB314E9906E,689DAD778FF08760E046228BA978220305CD5C32,CA7C2C7A30C8E8E1274A847651C67305FFC2E5C0 - - - name: Run Command - run: composer ci:php:${{ matrix.command }} diff --git a/.phive/phars.xml b/.phive/phars.xml deleted file mode 100644 index 875c1d19..00000000 --- a/.phive/phars.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/composer.json b/composer.json index e562ed6d..acf650a2 100644 --- a/composer.json +++ b/composer.json @@ -46,36 +46,5 @@ "branch-alias": { "dev-main": "9.0.x-dev" } - }, - "scripts": { - "ci": [ - "@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": "@php ./.phive/phpstan.phar --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": "@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": "@php ./.phive/phpstan.phar --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/php-cs-fixer.php b/config/php-cs-fixer.php deleted file mode 100644 index 88a9a692..00000000 --- a/config/php-cs-fixer.php +++ /dev/null @@ -1,34 +0,0 @@ -setRiskyAllowed(true) - ->setRules( - [ - '@PSR12' => true, - // Disable constant visibility from the PSR12 rule set as this would break compatibility with PHP < 7.1. - 'visibility_required' => ['elements' => ['property', 'method']], - - '@PHPUnit50Migration:risky' => true, - '@PHPUnit52Migration:risky' => true, - '@PHPUnit54Migration:risky' => true, - '@PHPUnit55Migration:risky' => true, - '@PHPUnit56Migration:risky' => true, - '@PHPUnit57Migration:risky' => true, - - 'php_unit_construct' => true, - 'php_unit_dedicate_assert' => ['target' => '5.6'], - 'php_unit_expectation' => ['target' => '5.6'], - 'php_unit_fqcn_annotation' => true, - 'php_unit_method_casing' => true, - 'php_unit_mock' => ['target' => '5.5'], - 'php_unit_mock_short_will_return' => true, - 'php_unit_namespaced' => ['target' => '5.7'], - 'php_unit_set_up_tear_down_visibility' => true, - 'php_unit_test_annotation' => ['style' => 'annotation'], - 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], - ] - ); 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. - - - - - - - - - - - - - diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon deleted file mode 100644 index 82fcb3f4..00000000 --- a/config/phpstan-baseline.neon +++ /dev/null @@ -1,12 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Call to an undefined method Sabberworm\\\\CSS\\\\OutputFormat\\:\\:setIndentation\\(\\)\\.$#" - count: 2 - path: ../src/OutputFormat.php - - - - message: "#^Class Sabberworm\\\\CSS\\\\Value\\\\Size constructor invoked with 5 parameters, 1\\-4 required\\.$#" - count: 2 - path: ../src/RuleSet/DeclarationBlock.php - diff --git a/config/phpstan.neon b/config/phpstan.neon deleted file mode 100644 index 3d7611a6..00000000 --- a/config/phpstan.neon +++ /dev/null @@ -1,18 +0,0 @@ -includes: - - phpstan-baseline.neon - -parameters: - parallel: - # Don't be overly greedy on machines with more CPU's to be a good neighbor especially on CI - maximumNumberOfProcesses: 5 - - level: 1 - - scanDirectories: - - %currentWorkingDirectory%/bin/ - - %currentWorkingDirectory%/src/ - - %currentWorkingDirectory%/tests/ - paths: - - %currentWorkingDirectory%/bin/ - - %currentWorkingDirectory%/src/ - - %currentWorkingDirectory%/tests/