Skip to content

Commit b1b9a11

Browse files
committed
Fixed a bug when phplint is active and only non-php files are commited
There was a bug when you try to commit (pre-hook) some non-php files. You receive the PHP Parallel Lint usage error every time. With this it will be marked as "skipped" when no files are available to pass trough the linter.
1 parent ef45aa5 commit b1b9a11

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Task/PhpLint.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ public function run(ContextInterface $context): TaskResultInterface
5353
->notPaths($config['ignore_patterns'])
5454
->extensions($config['triggered_by']);
5555

56+
if ($files->isEmpty()) {
57+
return TaskResult::createSkipped($this, $context);
58+
}
59+
5660
$arguments = $this->processBuilder->createArgumentsForCommand('parallel-lint');
5761
$arguments->add('--no-colors');
5862
$arguments->addOptionalArgumentWithSeparatedValue('-j', $config['jobs']);

0 commit comments

Comments
 (0)