@@ -15,7 +15,7 @@ export default {
15
15
grammarScopes : [ 'source.ruby' , 'source.ruby.rails' , 'source.ruby.rspec' ] ,
16
16
scope : 'file' ,
17
17
lintOnFly : true ,
18
- lint : ( activeEditor ) => {
18
+ lint : async ( activeEditor ) => {
19
19
const command = atom . config . get ( 'linter-ruby.rubyExecutablePath' ) ;
20
20
const ignored = atom . config . get ( 'linter-ruby.ignoredExtensions' ) ;
21
21
const filePath = activeEditor . getPath ( ) ;
@@ -25,23 +25,27 @@ export default {
25
25
return [ ] ;
26
26
}
27
27
28
- return helpers . exec ( command , [ '-wc' , '-E utf-8' ] , { stdin : activeEditor . getText ( ) , stream : 'stderr' } ) . then ( ( output ) => {
29
- const toReturn = [ ] ;
30
- output . split ( / \r ? \n / ) . forEach ( ( line ) => {
31
- const matches = regex . exec ( line ) ;
32
- if ( matches === null ) {
33
- return ;
34
- }
35
- const msgLine = Number . parseInt ( matches [ 1 ] - 1 , 10 ) ;
36
- toReturn . push ( {
37
- range : helpers . rangeFromLineNumber ( activeEditor , msgLine ) ,
38
- type : matches [ 2 ] ,
39
- text : matches [ 3 ] ,
40
- filePath,
41
- } ) ;
28
+ const execArgs = [ '-wc' , '-E utf-8' ] ;
29
+ const execOpts = {
30
+ stdin : activeEditor . getText ( ) ,
31
+ stream : 'stderr' ,
32
+ } ;
33
+ const output = await helpers . exec ( command , execArgs , execOpts ) ;
34
+ const toReturn = [ ] ;
35
+ output . split ( / \r ? \n / ) . forEach ( ( line ) => {
36
+ const matches = regex . exec ( line ) ;
37
+ if ( matches === null ) {
38
+ return ;
39
+ }
40
+ const msgLine = Number . parseInt ( matches [ 1 ] - 1 , 10 ) ;
41
+ toReturn . push ( {
42
+ range : helpers . rangeFromLineNumber ( activeEditor , msgLine ) ,
43
+ type : matches [ 2 ] ,
44
+ text : matches [ 3 ] ,
45
+ filePath,
42
46
} ) ;
43
- return toReturn ;
44
47
} ) ;
48
+ return toReturn ;
45
49
} ,
46
50
} ;
47
51
} ,
0 commit comments