From 332f20aaf2bf96bcf4f327420ab75aa58cd24c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 22 Nov 2024 19:28:03 +0100 Subject: [PATCH] Fix: Remove rector/rector --- .github/CONTRIBUTING.md | 12 ------ .github/settings.yml | 1 - .github/workflows/integrate.yaml | 59 ----------------------------- Makefile | 6 +-- composer.json | 1 - composer.lock | 65 ++------------------------------ rector.php | 36 ------------------ 7 files changed, 4 insertions(+), 176 deletions(-) delete mode 100644 rector.php diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 7b50cb9e..8a6cbd26 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -46,18 +46,6 @@ make dependency-analysis to run a dependency analysis. -## Refactoring - -We use [`rector/rector`](https://github.com/rectorphp/rector) to automatically refactor code. - -Run - -```sh -make refactoring -``` - -to automatically refactor code. - ## Security Analysis We use [`composer`](https://github.com/composer/composer) to run a security analysis. diff --git a/.github/settings.yml b/.github/settings.yml index 40625f11..a4fdd477 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -17,7 +17,6 @@ branches: - context: "Code Coverage (8.1, locked)" - context: "Coding Standards (8.1, locked)" - context: "Dependency Analysis (8.1, locked)" - - context: "Refactoring (8.1, locked)" - context: "Security Analysis (8.1, locked)" - context: "Static Code Analysis (8.1, locked)" - context: "Tests (8.1, highest)" diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 93cefd0c..af314796 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -198,65 +198,6 @@ jobs: - name: "Run maglnet/composer-require-checker" run: ".phive/composer-require-checker check --ansi --config-file=$(pwd)/composer-require-checker.json --verbose" - refactoring: - name: "Refactoring" - - runs-on: "ubuntu-latest" - - timeout-minutes: 5 - - strategy: - matrix: - php-version: - - "8.1" - - dependencies: - - "locked" - - steps: - - name: "Checkout" - uses: "actions/checkout@v4.2.2" - - - name: "Set up PHP" - uses: "shivammathur/setup-php@2.31.1" - with: - coverage: "none" - extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" - php-version: "${{ matrix.php-version }}" - - - name: "Set up problem matchers for PHP" - run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" - - - name: "Validate composer.json and composer.lock" - run: "composer validate --ansi --strict" - - - name: "Determine composer cache directory" - uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.9.2" - - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v4.1.2" - with: - path: "${{ env.COMPOSER_CACHE_DIR }}" - key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - - - name: "Install ${{ matrix.dependencies }} dependencies with composer" - uses: "ergebnis/.github/actions/composer/install@1.9.2" - with: - dependencies: "${{ matrix.dependencies }}" - - - name: "Cache cache directory for rector/rector" - uses: "actions/cache@v4.1.2" - with: - path: ".build/rector" - key: "php-${{ matrix.php-version }}-rector-${{ github.ref_name }}" - restore-keys: | - php-${{ matrix.php-version }}-rector-main - php-${{ matrix.php-version }}-rector- - - - name: "Run automated refactoring with rector/rector" - run: "vendor/bin/rector --ansi --config=rector.php --dry-run" - security-analysis: name: "Security Analysis" diff --git a/Makefile b/Makefile index f6d2909b..ca7af41b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .PHONY: it -it: refactoring coding-standards security-analysis static-code-analysis tests ## Runs the refactoring, coding-standards, security-analysis, static-code-analysis, and tests targets +it: coding-standards security-analysis static-code-analysis tests ## Runs the coding-standards, security-analysis, static-code-analysis, and tests targets .PHONY: code-coverage code-coverage: vendor ## Collects coverage from running integration tests with phpunit/phpunit @@ -24,10 +24,6 @@ help: ## Displays this list of targets with descriptions phive: .phive ## Installs dependencies with phive PHIVE_HOME=.build/phive phive install --trust-gpg-keys 0x033E5F8D801A2F8D -.PHONY: refactoring -refactoring: vendor ## Runs automated refactoring with rector/rector - vendor/bin/rector process --config=rector.php - .PHONY: security-analysis security-analysis: vendor ## Runs a security analysis with composer composer audit diff --git a/composer.json b/composer.json index debe340c..04b71daf 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,6 @@ "phpunit/phpunit": "^10.5.26", "psalm/plugin-phpunit": "~0.19.0", "psr/container": "^2.0.2", - "rector/rector": "^1.2.10", "vimeo/psalm": "^5.26.1" }, "autoload": { diff --git a/composer.lock b/composer.lock index 95b699e8..4da423ac 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "77c585eaa3af6c79148620cfab751879", + "content-hash": "bf1249a98a6fa6c818b8132ffa0e48bd", "packages": [ { "name": "nikic/php-parser", @@ -4795,65 +4795,6 @@ ], "time": "2024-06-11T12:45:25+00:00" }, - { - "name": "rector/rector", - "version": "1.2.10", - "source": { - "type": "git", - "url": "https://github.com/rectorphp/rector.git", - "reference": "40f9cf38c05296bd32f444121336a521a293fa61" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/40f9cf38c05296bd32f444121336a521a293fa61", - "reference": "40f9cf38c05296bd32f444121336a521a293fa61", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.12.5" - }, - "conflict": { - "rector/rector-doctrine": "*", - "rector/rector-downgrade-php": "*", - "rector/rector-phpunit": "*", - "rector/rector-symfony": "*" - }, - "suggest": { - "ext-dom": "To manipulate phpunit.xml via the custom-rule command" - }, - "bin": [ - "bin/rector" - ], - "type": "library", - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Instant Upgrade and Automated Refactoring of any PHP code", - "keywords": [ - "automation", - "dev", - "migration", - "refactoring" - ], - "support": { - "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/1.2.10" - }, - "funding": [ - { - "url": "https://github.com/tomasvotruba", - "type": "github" - } - ], - "time": "2024-11-08T13:59:10+00:00" - }, { "name": "sebastian/cli-parser", "version": "2.0.1", @@ -7416,14 +7357,14 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "ext-mbstring": "*" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "8.1.26" }, diff --git a/rector.php b/rector.php deleted file mode 100644 index 815fe86f..00000000 --- a/rector.php +++ /dev/null @@ -1,36 +0,0 @@ -cacheDirectory(__DIR__ . '/.build/rector/'); - - $rectorConfig->paths([ - __DIR__ . '/src/', - __DIR__ . '/test/', - ]); - - $rectorConfig->phpVersion(ValueObject\PhpVersion::PHP_81); - - $rectorConfig->rules([ - Php81\Rector\Property\ReadOnlyPropertyRector::class, - ]); - - $rectorConfig->sets([ - PHPUnit\Set\PHPUnitSetList::PHPUNIT_100, - ]); -};