Skip to content

Commit 00d7cd4

Browse files
authored
Merge pull request #4 from 123inkt/Normalize-filepath-in-baseline-report
Baseline report should always have forward slashes for path separator.
2 parents 9433165 + f23bd76 commit 00d7cd4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Reports/Baseline.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources = fals
3939
foreach ($lineErrors as $colErrors) {
4040
foreach ($colErrors as $error) {
4141
$out->startElement('violation');
42-
$out->writeAttribute('file', $report['filename']);
42+
$out->writeAttribute('file', str_replace('\\', '/', $report['filename']));
4343
$out->writeAttribute('sniff', $error['source']);
4444
$out->writeAttribute('signature', $signature);
4545

tests/Unit/Reports/BaselineTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testGenerateFileReportEmptyShouldReturnFalse(): void
3838
public function testGenerateFileReportShouldPrintReport(): void
3939
{
4040
$reportData = [
41-
'filename' => '/test/foobar.txt',
41+
'filename' => '/test\\foobar.txt',
4242
'errors' => 1,
4343
'warnings' => 0,
4444
'messages' => [5 => [[['source' => 'MySniff']]]],

0 commit comments

Comments
 (0)