diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 40dc8ea..e5fb17a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,6 +58,10 @@ jobs: - name: Linter run: composer lint:check + - name: Rector + if: runner.os != 'Windows' + run: composer rector:check + - name: Type Coverage if: runner.os != 'Windows' run: composer test:types diff --git a/README.md b/README.md index 2df0938..5460480 100644 --- a/README.md +++ b/README.md @@ -758,14 +758,22 @@ the filter that serves it, since the built in filter refuses an operation it doe composer test ``` -That runs static analysis, the formatting check, the type coverage check and the test -suite. Each step is also available on its own: +That runs static analysis, the formatting check, the refactoring check, the type coverage +check and the test suite. Each step is also available on its own: ```bash -composer analyse # PHPStan -composer lint:check # Pint, in check mode -composer test:types # Pest type coverage -composer test:unit # Pest +composer analyse # PHPStan +composer lint:check # Pint, in check mode +composer rector:check # Rector, as a dry run +composer test:types # Pest type coverage +composer test:unit # Pest +``` + +`composer lint` applies the formatting rather than checking it. Rector has no apply script +on purpose, so a refactoring it proposes is read before it is taken: + +```bash +vendor/bin/rector process ``` ## Contributing diff --git a/composer.json b/composer.json index bec7637..5198d9a 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "spatie/laravel-query-builder": "^7.3.1" }, "require-dev": { - "driftingly/rector-laravel": "^2.0", + "driftingly/rector-laravel": "^2.6", "larastan/larastan": "^3.9", "laravel/pao": "^1.0", "laravel/pint": "^1.29", @@ -42,7 +42,7 @@ "phpstan/extension-installer": "^1.4", "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-phpunit": "^2.0", - "rector/rector": "^2.0" + "rector/rector": "^2.6" }, "autoload": { "psr-4": { @@ -94,6 +94,7 @@ "test": [ "@analyse", "@lint:check", + "@rector:check", "@test:types", "@test:unit" ],