From 6390b139c280491338932c5ca838194cdbe3c6ed 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 | 3 +- composer.lock | 61 +------------------------------- phpstan.neon | 1 - rector.php | 39 -------------------- 8 files changed, 3 insertions(+), 179 deletions(-) delete mode 100644 rector.php diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index acfd6346..f5af0474 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 16349358..6c170c4c 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 f425d35c..13f5a0b9 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 0961d6e1..f61ff4fb 100644 --- a/composer.json +++ b/composer.json @@ -36,8 +36,7 @@ "phpstan/phpstan-deprecation-rules": "^1.2.1", "phpstan/phpstan-strict-rules": "^1.6.1", "phpunit/phpunit": "^10.5.26", - "psr/container": "^2.0.2", - "rector/rector": "^1.2.10" + "psr/container": "^2.0.2" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index c76f21a2..f21122f4 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": "37f283d866da7a62e3819810ba527c64", + "content-hash": "897c3e07ab6824d9e7d26acde79ba171", "packages": [ { "name": "nikic/php-parser", @@ -4091,65 +4091,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", diff --git a/phpstan.neon b/phpstan.neon index 7e18b67c..396b54ef 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -23,7 +23,6 @@ parameters: - src/ - test/ - .php-cs-fixer.php - - rector.php tmpDir: .build/phpstan/ diff --git a/rector.php b/rector.php deleted file mode 100644 index cac8d1f7..00000000 --- a/rector.php +++ /dev/null @@ -1,39 +0,0 @@ -cacheDirectory(__DIR__ . '/.build/rector/'); - - $rectorConfig->paths([ - __DIR__ . '/src/', - __DIR__ . '/test/', - __DIR__ . '/.php-cs-fixer.fixture.php', - __DIR__ . '/.php-cs-fixer.php', - __DIR__ . '/rector.php', - ]); - - $rectorConfig->phpVersion(ValueObject\PhpVersion::PHP_81); - - $rectorConfig->rules([ - Php81\Rector\Property\ReadOnlyPropertyRector::class, - ]); - - $rectorConfig->sets([ - PHPUnit\Set\PHPUnitSetList::PHPUNIT_100, - ]); -};