Skip to content

Commit

Permalink
Used colons for separating the line and column number in the prose fo…
Browse files Browse the repository at this point in the history
…rmatter. (palantir#4222)

Fixes palantir#3861.
  • Loading branch information
reduckted authored and Josh Goldberg committed Nov 5, 2018
1 parent 1e9ed49 commit 0172fab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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} - `;
}
});

0 comments on commit 0172fab

Please sign in to comment.