-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(code quality): add rector package
- Loading branch information
Showing
13 changed files
with
136 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Rector | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
|
||
jobs: | ||
rector: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Rector Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/rector | ||
key: ${{ runner.os }}-rector-${{ github.run_id }} | ||
restore-keys: ${{ runner.os }}-rector- | ||
|
||
- run: mkdir -p /tmp/rector | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
coverage: none | ||
|
||
- name: Install composer dependencies | ||
uses: ramsey/composer-install@v3 | ||
|
||
- name: Rector Dry Run | ||
run: php vendor/bin/rector process --dry-run --config=rector.php | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Caching\ValueObject\Storage\FileCacheStorage; | ||
use Rector\Config\RectorConfig; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector; | ||
|
||
return RectorConfig::configure() | ||
->withParallel() | ||
->withPaths([ | ||
__DIR__.'/config', | ||
__DIR__.'/resources', | ||
__DIR__.'/routes', | ||
__DIR__.'/src', | ||
// __DIR__.'/tests', | ||
]) | ||
->withPhpSets() | ||
->withPreparedSets( | ||
deadCode: true, | ||
codeQuality: true, | ||
// codingStyle: true, | ||
typeDeclarations: true, | ||
privatization: true, | ||
naming: true, | ||
// instanceof: true, | ||
earlyReturn: true, | ||
// strictBooleans: true, | ||
) | ||
->withRules([ | ||
AddVoidReturnTypeWhereNoReturnRector::class, | ||
]) | ||
->withCache( | ||
// ensure file system caching is used instead of in-memory | ||
cacheClass: FileCacheStorage::class, | ||
|
||
// specify a path that works locally as well as on CI job runners | ||
cacheDirectory: '/tmp/rector' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.