From d931c8987563fbe5a05e411722a6f53da6f1b555 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Fri, 5 Jul 2024 14:28:54 +0200 Subject: [PATCH] Show a hint about `-vv` for unignorable errors when generating the baseline --- src/Command/AnalyseCommand.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Command/AnalyseCommand.php b/src/Command/AnalyseCommand.php index f30200feef..21019ca695 100644 --- a/src/Command/AnalyseCommand.php +++ b/src/Command/AnalyseCommand.php @@ -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('Unignorable errors could not be added to the baseline:'); $inceptionResult->getStdOutput()->writeLineFormatted($fileSpecificError->getMessage()); $inceptionResult->getStdOutput()->writeLineFormatted($fileSpecificError->getFile()); $inceptionResult->getStdOutput()->writeLineFormatted(''); @@ -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;