Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 5596dda

Browse files
authored
Merge pull request #102 from AtomLinter/arcanemagus/fix-style
Fix styling of syntax errors
2 parents 55392a4 + 5147b2a commit 5596dda

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ export default {
5151
let match = regex.exec(output);
5252
while (match !== null) {
5353
const msgLine = Number.parseInt(match[1] - 1, 10);
54+
const type = match[2] === 'warning' ? 'Warning' : 'Error';
5455
toReturn.push({
5556
range: helpers.rangeFromLineNumber(textEditor, msgLine),
56-
type: match[2],
57+
type,
5758
text: match[3],
5859
filePath,
5960
});

spec/linter-ruby-spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ describe('The Ruby provider for Linter', () => {
4343
lint(editor).then((messages) => {
4444
expect(messages.length).toBe(2);
4545

46-
expect(messages[0].type).toBe('warning');
46+
expect(messages[0].type).toBe('Warning');
4747
expect(messages[0].html).not.toBeDefined();
4848
expect(messages[0].text).toBe('assigned but unused variable - payload');
4949
expect(messages[0].filePath).toBe(badPath);
5050
expect(messages[0].range).toEqual([[1, 2], [1, 13]]);
5151

52-
expect(messages[1].type).toBe('syntax error');
52+
expect(messages[1].type).toBe('Error');
5353
expect(messages[1].html).not.toBeDefined();
5454
expect(messages[1].text).toBe('unexpected keyword_end, expecting end-of-input');
5555
expect(messages[1].filePath).toBe(badPath);

0 commit comments

Comments
 (0)