coolify/rector.php
peaklabs-dev e5c54f94f4
chore(tooling): ignore NewlineBetweenClassLikeStmtsRector rector rule
- this rule adds newlines between enum cases which is incorrect and pint already formats all other cases covered by this rule via its class_attributes_separation rule
2025-12-16 17:08:59 +01:00

87 lines
3.2 KiB
PHP

<?php
declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodingStyle\Rector\ClassLike\NewlineBetweenClassLikeStmtsRector;
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\NotIdentical\MbStrContainsRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\Php85\Rector\Expression\NestedFuncCallsToPipeOperatorRector;
use Rector\Php85\Rector\StmtsAwareInterface\SequentialAssignmentsToPipeOperatorRector;
use RectorLaravel\Rector\Class_\RemoveModelPropertyFromFactoriesRector;
use RectorLaravel\Rector\Empty_\EmptyToBlankAndFilledFuncRector;
use RectorLaravel\Rector\FuncCall\ConfigToTypedConfigMethodCallRector;
use RectorLaravel\Rector\FuncCall\RemoveDumpDataDeadCodeRector;
use RectorLaravel\Rector\MethodCall\WhereToWhereLikeRector;
use RectorLaravel\Rector\StaticCall\RequestStaticValidateToInjectRector;
use RectorLaravel\Set\LaravelSetList;
use RectorLaravel\Set\LaravelSetProvider;
return RectorConfig::configure()
->withPaths([
__DIR__.'/app',
__DIR__.'/bootstrap',
__DIR__.'/config',
__DIR__.'/database',
__DIR__.'/public',
__DIR__.'/routes',
__DIR__.'/tests',
])
->withRootFiles()
->withSkip([
__DIR__.'/bootstrap/cache',
AddOverrideAttributeToOverriddenMethodsRector::class,
NewlineBetweenClassLikeStmtsRector::class,
])
->withCache(__DIR__.'/storage/rector', FileCacheStorage::class)
->withPhpSets()
->withAttributesSets()
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
typeDeclarationDocblocks: true,
privatization: true,
instanceOf: true,
earlyReturn: true,
carbon: true,
rectorPreset: true,
)
->withSetProviders(LaravelSetProvider::class)
->withComposerBased(laravel: true)
->withSets([
LaravelSetList::LARAVEL_ARRAYACCESS_TO_METHOD_CALL,
LaravelSetList::LARAVEL_ARRAY_STR_FUNCTION_TO_STATIC_CALL,
LaravelSetList::LARAVEL_CODE_QUALITY,
LaravelSetList::LARAVEL_COLLECTION,
LaravelSetList::LARAVEL_CONTAINER_STRING_TO_FULLY_QUALIFIED_NAME,
LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES,
LaravelSetList::LARAVEL_FACTORIES,
LaravelSetList::LARAVEL_IF_HELPERS,
LaravelSetList::LARAVEL_LEGACY_FACTORIES_TO_CLASSES,
LaravelSetList::LARAVEL_TESTING,
LaravelSetList::LARAVEL_TYPE_DECLARATIONS,
])
->withRules([
// Core Rector Rules
SequentialAssignmentsToPipeOperatorRector::class,
NestedFuncCallsToPipeOperatorRector::class,
MbStrContainsRector::class,
// Laravel Rector Rules
EmptyToBlankAndFilledFuncRector::class,
ConfigToTypedConfigMethodCallRector::class,
RemoveModelPropertyFromFactoriesRector::class,
RequestStaticValidateToInjectRector::class,
])
->withConfiguredRule(RemoveDumpDataDeadCodeRector::class, [
'dd',
'ddd',
'dump',
'ray',
])
->withConfiguredRule(WhereToWhereLikeRector::class, [
WhereToWhereLikeRector::USING_POSTGRES_DRIVER => true,
]);