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

Commit e6aab97

Browse files

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

lib/main.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default {
3030
name: 'Ruby',
3131
grammarScopes: ['source.ruby', 'source.ruby.rails', 'source.ruby.rspec'],
3232
scope: 'file',
33-
lintOnFly: true,
33+
lintsOnChange: true,
3434
lint: async (textEditor) => {
3535
const filePath = textEditor.getPath();
3636
if (!filePath) {
@@ -65,12 +65,14 @@ export default {
6565
let match = regex.exec(output);
6666
while (match !== null) {
6767
const msgLine = Number.parseInt(match[1] - 1, 10);
68-
const type = match[2] === 'warning' ? 'Warning' : 'Error';
68+
const severity = match[2] === 'warning' ? 'warning' : 'error';
6969
toReturn.push({
70-
range: helpers.generateRange(textEditor, msgLine),
71-
type,
72-
text: match[3],
73-
filePath,
70+
severity,
71+
location: {
72+
file: filePath,
73+
position: helpers.generateRange(textEditor, msgLine),
74+
},
75+
excerpt: match[3],
7476
});
7577
match = regex.exec(output);
7678
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"providedServices": {
3535
"linter": {
3636
"versions": {
37-
"1.0.0": "provideLinter"
37+
"2.0.0": "provideLinter"
3838
}
3939
}
4040
},
@@ -55,7 +55,7 @@
5555
"jasmine-fix": "^1.3.1"
5656
},
5757
"package-deps": [
58-
"linter"
58+
"linter:2.0.0"
5959
],
6060
"scripts": {
6161
"commitmsg": "commitlint -e $GIT_PARAMS",

spec/linter-ruby-spec.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,15 @@ describe('The Ruby provider for Linter', () => {
3333

3434
expect(messages.length).toBe(2);
3535

36-
expect(messages[0].type).toBe('Warning');
37-
expect(messages[0].html).not.toBeDefined();
38-
expect(messages[0].text).toBe('assigned but unused variable - payload');
39-
expect(messages[0].filePath).toBe(badPath);
40-
expect(messages[0].range).toEqual([[1, 2], [1, 13]]);
41-
42-
expect(messages[1].type).toBe('Error');
43-
expect(messages[1].html).not.toBeDefined();
44-
expect(messages[1].text).toBe('unexpected keyword_end, expecting end-of-input');
45-
expect(messages[1].filePath).toBe(badPath);
46-
expect(messages[1].range).toEqual([[12, 0], [12, 18]]);
36+
expect(messages[0].severity).toBe('warning');
37+
expect(messages[0].excerpt).toBe('assigned but unused variable - payload');
38+
expect(messages[0].location.file).toBe(badPath);
39+
expect(messages[0].location.position).toEqual([[1, 2], [1, 13]]);
40+
41+
expect(messages[1].severity).toBe('error');
42+
expect(messages[1].excerpt).toBe('unexpected keyword_end, expecting end-of-input');
43+
expect(messages[1].location.file).toBe(badPath);
44+
expect(messages[1].location.position).toEqual([[12, 0], [12, 18]]);
4745
});
4846

4947
it('checks good.rb and reports nothing wrong', async () => {

0 commit comments

Comments
 (0)