Skip to content

Commit 42fb77b

Browse files
authored
Merge pull request #902 from himanshu007-creator/patch-2
added newline for better ANSI output
2 parents 2e2cafc + 5e5cbe7 commit 42fb77b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/main/php/PHPMD/Renderer/AnsiRenderer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ private function writeViolationsReport(Report $report)
3838
$previousFile = null;
3939
foreach ($report->getRuleViolations() as $violation) {
4040
if ($violation->getFileName() !== $previousFile) {
41+
if ($previousFile !== null) {
42+
$this->getWriter()->write(PHP_EOL);
43+
}
44+
4145
$this->writeViolationFileHeader($violation);
4246
}
4347

src/test/php/PHPMD/Renderer/AnsiRendererTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function testRendererOutputsForReportWithContents()
7373
$expectedChunks = array(
7474
PHP_EOL . "FILE: /bar.php" . PHP_EOL . "--------------" . PHP_EOL,
7575
" 1 | \e[31mVIOLATION\e[0m | Test description" . PHP_EOL,
76+
PHP_EOL,
7677
PHP_EOL . "FILE: /foo.php" . PHP_EOL . "--------------" . PHP_EOL,
7778
" 2 | \e[31mVIOLATION\e[0m | Test description" . PHP_EOL,
7879
" 3 | \e[31mVIOLATION\e[0m | Test description" . PHP_EOL,

0 commit comments

Comments
 (0)