Skip to content

Commit 440920f

Browse files
committed
BaseCodeAnalyzerPreCommitHook bug fixes
1 parent 121fc72 commit 440920f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Console/Commands/Hooks/BaseCodeAnalyzerPreCommitHook.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ public function handleCommittedFiles(ChangedFiles $files, Closure $next)
8888

8989
$this->commitFailMessage()
9090
->suggestAutoFixOrExit();
91+
92+
return $next($files);
9193
}
9294

9395
/**
@@ -145,11 +147,12 @@ protected function canFileBeAnalyzed(ChangedFile $file): bool
145147
protected function commitFailMessage()
146148
{
147149
$this->command->newLine();
148-
$this->command->getOutput()->writeln(
149-
'<bg=red;fg=white> COMMIT FAILED </> '.
150-
sprintf('Your commit contains files that should pass %s but do not. Please fix the errors in the files above and try again.',
151-
$this->getName())
152-
);
150+
151+
$message = '<bg=red;fg=white> COMMIT FAILED </> ';
152+
$message .= sprintf("Your commit contains files that should pass %s but do not. Please fix the errors in the files above and try again.\n", $this->getName());
153+
$message .= sprintf("You can check which %s errors happened in them by executing: <comment>%s {filePath}</comment>", $this->getName(), $this->analyzerCommand());
154+
155+
$this->command->getOutput()->writeln($message);
153156

154157
return $this;
155158
}

0 commit comments

Comments
 (0)