Skip to content

Commit

Permalink
Merge pull request #868 from ergebnis/fix/rector
Browse files Browse the repository at this point in the history
Fix: Remove `rector/rector`
  • Loading branch information
localheinz authored Nov 22, 2024
2 parents 5c99970 + 6390b13 commit 1bacba0
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 179 deletions.
12 changes: 0 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
59 changes: 0 additions & 59 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
61 changes: 1 addition & 60 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ parameters:
- test/
- .php-cs-fixer.fixture.php
- .php-cs-fixer.php
- rector.php

tmpDir: .build/phpstan/

Expand Down
39 changes: 0 additions & 39 deletions rector.php

This file was deleted.

0 comments on commit 1bacba0

Please sign in to comment.