Skip to content

Commit 37aca27

Browse files
author
Nicholas C. Zakas
committed
Fixup compact format
1 parent e7748ce commit 37aca27

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/formatters/compact.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ CSSLint.addFormatter({
4747

4848
messages.forEach(function(message, i) {
4949
if (message.rollup) {
50-
output += capitalize(message.type) + ": " + filename + ": " + message.message + "\n";
50+
output += filename + ": " + capitalize(message.type) + " - " + message.message + "\n";
5151
} else {
52-
output += capitalize(message.type) + ": " + filename + ": " + "line " + message.line +
53-
", col " + message.col + ", " + message.message + "\n";
52+
output += filename + ": " + "line " + message.line +
53+
", col " + message.col + ", " + capitalize(message.type) + " - " + message.message + "\n";
5454
}
5555
});
5656

tests/formatters/compact.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
{ type: 'error', line: 2, col: 1, message: 'BOGUS ERROR', evidence: 'BOGUS', rule: [] },
2424
{ type: 'warning', line: 1, col: 1, message: 'BOGUS WARNING', evidence: 'BOGUS', rule: [] }
2525
], stats: [] },
26-
err = "Error: path/to/FILE: line 2, col 1, BOGUS ERROR\n",
27-
warning = "Warning: path/to/FILE: line 1, col 1, BOGUS WARNING\n",
26+
err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR\n",
27+
warning = "path/to/FILE: line 1, col 1, Warning - BOGUS WARNING\n",
2828
expected = err + warning,
2929
actual = CSSLint.getFormatter("compact").formatResults(result, "path/to/FILE", {fullPath: "/absolute/path/to/FILE"});
3030
Assert.areEqual(expected, actual);
@@ -35,8 +35,8 @@
3535
{ type: 'error', line: 2, col: 1, message: 'BOGUS ERROR', evidence: 'BOGUS', rule: [] },
3636
{ type: 'warning', line: 1, col: 1, message: 'BOGUS WARNING', evidence: 'BOGUS', rule: [] }
3737
], stats: [] },
38-
err = "Error: path/to/FILE: line 2, col 1, BOGUS ERROR\n",
39-
warning = "Warning: path/to/FILE: line 1, col 1, BOGUS WARNING\n",
38+
err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR\n",
39+
warning = "path/to/FILE: line 1, col 1, Warning - BOGUS WARNING\n",
4040
expected = err + warning,
4141
actual = CSSLint.getFormatter("compact").formatResults(result, "path/to/FILE", {fullPath: "/absolute/path/to/FILE"});
4242
Assert.areEqual(expected, actual);

0 commit comments

Comments
 (0)