Skip to content

Commit

Permalink
Merge pull request #4 from yamadashy/feature/improve-format
Browse files Browse the repository at this point in the history
feat: Improve error output formatting
  • Loading branch information
yamadashy authored Sep 21, 2024
2 parents 1f0809b + 447d2fa commit 9b4e4e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Binary file modified docs/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/FriendlyErrorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
return 0;
}

$output->writeLineFormatted('');
$this->writeFileSpecificErrors($analysisResult, $output);
$this->writeNotFileSpecificErrors($analysisResult, $output);
$this->writeWarnings($analysisResult, $output);
Expand All @@ -62,8 +63,8 @@ private function writeFileSpecificErrors(AnalysisResult $analysisResult, Output
}

foreach ($errorsByFile as $relativeFilePath => $errors) {
$output->writeLineFormatted($relativeFilePath);
$output->writeLineFormatted(str_repeat('-', mb_strlen($relativeFilePath)));
$output->writeLineFormatted("{$relativeFilePath}");
$output->writeLineFormatted('--'.str_repeat('-', mb_strlen($relativeFilePath)));
$output->writeLineFormatted('');

foreach ($errors as $error) {
Expand Down

0 comments on commit 9b4e4e7

Please sign in to comment.