Skip to content
This repository was archived by the owner on May 25, 2020. It is now read-only.

Commit 7b9084a

Browse files
committed
If there's no changes for this file (which means there are only removed lines), clear all messages.
1 parent 3ffda52 commit 7b9084a

File tree

1 file changed

+3
-1
lines changed
  • src/DiffSniffer/CodeSniffer/Reports

1 file changed

+3
-1
lines changed

src/DiffSniffer/CodeSniffer/Reports/Xml.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,14 @@ protected function filterReport(array $report, array $changes)
207207
$filename = $report['filename'];
208208
if (strpos($filename, $this->baseDir . DIRECTORY_SEPARATOR) === 0) {
209209
$relative = substr($filename, strlen($this->baseDir) + 1);
210+
$report['filename'] = $relative;
210211
if (isset($changes[$relative])) {
211-
$report['filename'] = $relative;
212212
$report['messages'] = array_intersect_key(
213213
$report['messages'],
214214
array_flip($changes[$relative])
215215
);
216+
} else {
217+
$report['messages'] = array();
216218
}
217219
}
218220

0 commit comments

Comments
 (0)