Skip to content

Commit

Permalink
Updated Rector rules to use the latest Drupal Finder.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Jul 19, 2024
1 parent 2f9fc4e commit 4fb3264
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@

declare(strict_types=1);

use DrupalFinder\DrupalFinder;
use DrupalFinder\DrupalFinderComposerRuntime;
use DrupalRector\Set\Drupal10SetList;
use DrupalRector\Set\Drupal8SetList;
use DrupalRector\Set\Drupal9SetList;
use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector;
Expand All @@ -30,8 +28,7 @@
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;

return static function (RectorConfig $rectorConfig): void {
$drupalFinder = new DrupalFinder();
$drupalFinder->locateRoot(__DIR__);
$drupalFinder = new DrupalFinderComposerRuntime();
$drupalRoot = $drupalFinder->getDrupalRoot();

$rectorConfig->autoloadPaths([
Expand Down Expand Up @@ -69,13 +66,11 @@

$rectorConfig->skip([
// Rules added by Rector's rule sets.
ArraySpreadInsteadOfArrayMergeRector::class,
CountArrayToEmptyArrayComparisonRector::class,
DisallowedEmptyRuleFixerRector::class,
InlineArrayReturnAssignRector::class,
NewlineAfterStatementRector::class,
NewlineBeforeNewAssignSetRector::class,
PostIncDecToPreIncDecRector::class,
RemoveAlwaysTrueIfConditionRector::class,
SimplifyEmptyCheckOnEmptyArrayRector::class,
// Dependencies.
Expand Down

1 comment on commit 4fb3264

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.