Skip to content

Commit

Permalink
Don't print newline if no failures in fileslist formatter (palantir#1563
Browse files Browse the repository at this point in the history
)

Addresses review #875140 in PR palantir#1558 for compatibility with discussion item palantir#1553
  • Loading branch information
nomaed authored and adidahiya committed Sep 21, 2016
1 parent 5cc19bd commit 424ce70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/formatters/fileslistFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import {RuleFailure} from "../language/rule/rule";

export class Formatter extends AbstractFormatter {
public format(failures: RuleFailure[]): string {
if (failures.length === 0) {
return "";
}

const files: string[] = [];
let currentFile: string;

Expand Down
2 changes: 1 addition & 1 deletion test/formatters/fileslistFormatterTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ describe("Files-list Formatter", () => {

it("handles no failures", () => {
const result = formatter.format([]);
assert.equal(result, "\n");
assert.equal(result, "");
});
});

0 comments on commit 424ce70

Please sign in to comment.