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

Fix styling of syntax errors #102

Merged
merged 1 commit into from
Dec 2, 2016
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
3 changes: 2 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ export default {
let match = regex.exec(output);
while (match !== null) {
const msgLine = Number.parseInt(match[1] - 1, 10);
const type = match[2] === 'warning' ? 'Warning' : 'Error';
toReturn.push({
range: helpers.rangeFromLineNumber(textEditor, msgLine),
type: match[2],
type,
text: match[3],
filePath,
});
Expand Down
4 changes: 2 additions & 2 deletions spec/linter-ruby-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ describe('The Ruby provider for Linter', () => {
lint(editor).then((messages) => {
expect(messages.length).toBe(2);

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

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