From 96809594f0b784e36399557fd527c7de67dd008f Mon Sep 17 00:00:00 2001 From: Ulrich Buchgraber Date: Wed, 13 Mar 2019 00:30:20 +0100 Subject: [PATCH] Fix "inspection" formatter paths for TeamCity instances running on Windows --- src/lib/formatters/inspections.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/formatters/inspections.ts b/src/lib/formatters/inspections.ts index a1bd7ce..d52f432 100644 --- a/src/lib/formatters/inspections.ts +++ b/src/lib/formatters/inspections.ts @@ -26,7 +26,8 @@ export function formatAsInspections(failures: RuleFailure[], config: { [key: str ); result.messages.forEach(failure => { - const filePath = path.relative(process.cwd(), failure.getFileName()); + const relativeFilePath = path.relative(process.cwd(), failure.getFileName()); + const filePath = relativeFilePath.replace(/\\/g, '/'); // Ensure slashes on Windows const startPos = failure.getStartPosition().getLineAndCharacter(); const formattedMessage = `line ${startPos.line}, col ${ startPos.character