Skip to content

Commit

Permalink
Show a hint about -vv for unignorable errors when generating the ba…
Browse files Browse the repository at this point in the history
…seline
  • Loading branch information
ondrejmirtes committed Jul 5, 2024
1 parent 5a63154 commit d931c89
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Command/AnalyseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ private function generateBaseline(string $generateBaselineFile, InceptionResult
if (!$fileSpecificError->canBeIgnored()) {
$unignorableCount++;
if ($output->isVeryVerbose()) {
$inceptionResult->getStdOutput()->writeLineFormatted('Unignorable could not be added to the baseline:');
$inceptionResult->getStdOutput()->writeLineFormatted('<error>Unignorable errors could not be added to the baseline:</error>');
$inceptionResult->getStdOutput()->writeLineFormatted($fileSpecificError->getMessage());
$inceptionResult->getStdOutput()->writeLineFormatted($fileSpecificError->getFile());
$inceptionResult->getStdOutput()->writeLineFormatted('');
Expand All @@ -624,7 +624,11 @@ private function generateBaseline(string $generateBaselineFile, InceptionResult
) {
$inceptionResult->getStdOutput()->getStyle()->success($message);
} else {
$inceptionResult->getStdOutput()->getStyle()->warning($message . "\nSome errors could not be put into baseline. Re-run PHPStan and fix them.");
if ($output->isVeryVerbose()) {
$inceptionResult->getStdOutput()->getStyle()->warning($message . "\nSome errors could not be put into baseline.");
} else {
$inceptionResult->getStdOutput()->getStyle()->warning($message . "\nSome errors could not be put into baseline. Re-run PHPStan with \"-vv\" and fix them.");
}
}

$exitCode = 0;
Expand Down

0 comments on commit d931c89

Please sign in to comment.