Skip to content

Commit

Permalink
Add basic validation for skipped path (#5628)
Browse files Browse the repository at this point in the history
  • Loading branch information
integer committed Feb 16, 2024
1 parent f347c73 commit 2ccf2de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Configuration/RectorConfigBuilder.php
Expand Up @@ -24,6 +24,7 @@
use Rector\Symfony\Set\SymfonySetList;
use Rector\ValueObject\PhpVersion;
use Symfony\Component\Finder\Finder;
use Webmozart\Assert\Assert;

/**
* @api
Expand Down Expand Up @@ -273,6 +274,10 @@ public function withSkip(array $skip): self

public function withSkipPath(string $skipPath): self
{
if (!str_contains($skipPath, '*')) {
Assert::fileExists($skipPath);
}

return $this->withSkip([$skipPath]);
}

Expand Down

0 comments on commit 2ccf2de

Please sign in to comment.