From b8bb6680e81c7d4c67d0593c450ba45a34ea574a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 10 Oct 2026 23:48:43 +0200 Subject: [PATCH] Condense run output by trimming blank lines around success block and footer --- blink/internal/reporter/reporter.go | 5 ++--- src/Console/Command/CheckCommand.php | 1 - src/Console/Output/ConsoleOutputFormatter.php | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/blink/internal/reporter/reporter.go b/blink/internal/reporter/reporter.go index a5f09cef87..3d803f7566 100644 --- a/blink/internal/reporter/reporter.go +++ b/blink/internal/reporter/reporter.go @@ -31,14 +31,13 @@ func Report(w io.Writer, results []runner.FileResult, isFixer bool) int { if !isFixer { f.reportFileDiffs(results) } - f.newLine(1) if len(results) == 0 { f.success("No errors found. Great job - your code is shiny in style!") return 0 } - f.newLine(1) + f.newLine(2) n := len(results) if isFixer { @@ -62,7 +61,7 @@ func Report(w io.Writer, results []runner.FileResult, isFixer bool) int { // Footer prints an ECS-style run summary: files scanned, time and memory. func Footer(w io.Writer, files int, d time.Duration, memBytes uint64) { - _, _ = fmt.Fprintf(w, "\n // %d files · %s · %d MB\n", files, d.Truncate(time.Millisecond), memBytes/(1024*1024)) + _, _ = fmt.Fprintf(w, " // %d files · %s · %d MB\n", files, d.Truncate(time.Millisecond), memBytes/(1024*1024)) } func newFormatter(w io.Writer) formatter { diff --git a/src/Console/Command/CheckCommand.php b/src/Console/Command/CheckCommand.php index bfb4ed9289..f068f78538 100644 --- a/src/Console/Command/CheckCommand.php +++ b/src/Console/Command/CheckCommand.php @@ -125,7 +125,6 @@ private function printRunFooter(int $filesCount, float $startTime): void $elapsedMilliseconds = (int) round((microtime(true) - $startTime) * 1000); $peakMemoryMegabytes = (int) round(memory_get_peak_usage(true) / 1024 / 1024); - $this->easyCodingStandardStyle->newLine(); $this->easyCodingStandardStyle->writeln( sprintf(' // %d files · %dms · %d MB', $filesCount, $elapsedMilliseconds, $peakMemoryMegabytes) ); diff --git a/src/Console/Output/ConsoleOutputFormatter.php b/src/Console/Output/ConsoleOutputFormatter.php index 978943459b..1634a253c7 100644 --- a/src/Console/Output/ConsoleOutputFormatter.php +++ b/src/Console/Output/ConsoleOutputFormatter.php @@ -31,15 +31,13 @@ public function report(ErrorAndDiffResult $errorAndDiffResult, Configuration $co $this->reportFileDiffs($errorAndDiffResult->getFileDiffs()); } - $this->easyCodingStandardStyle->newLine(1); - if ($errorAndDiffResult->getErrorCount() === 0 && $errorAndDiffResult->getFileDiffsCount() === 0) { $this->easyCodingStandardStyle->success('No errors found. Great job - your code is shiny in style!'); return $this->exitCodeResolver->resolve($errorAndDiffResult, $configuration); } - $this->easyCodingStandardStyle->newLine(); + $this->easyCodingStandardStyle->newLine(2); if ($configuration->isFixer()) { $this->printAfterFixerStatus($errorAndDiffResult, $configuration);