Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Used colons for separating the line and character number in prose formatter #4222

Merged
merged 1 commit into from
Nov 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/formatters/proseFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ export class Formatter extends AbstractFormatter {
const failureString = failure.getFailure();

const lineAndCharacter = failure.getStartPosition().getLineAndCharacter();
const positionTuple = `[${lineAndCharacter.line + 1}, ${lineAndCharacter.character + 1}]`;
const positionTuple = `${lineAndCharacter.line + 1}:${lineAndCharacter.character + 1}`;

return `${failure.getRuleSeverity().toUpperCase()}: ${fileName}${positionTuple}: ${failureString}`;
return `${failure
.getRuleSeverity()
.toUpperCase()}: ${fileName}:${positionTuple} - ${failureString}`;
});

return `${fixLines.concat(errorLines).join("\n")}\n`;
Expand Down
2 changes: 1 addition & 1 deletion test/formatters/proseFormatterTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ describe("Prose Formatter", () => {
});

function getPositionString(line: number, character: number) {
return `[${line}, ${character}]: `;
return `:${line}:${character} - `;
}
});