@@ -73,8 +73,7 @@ const parseClangRanges = (ranges) => {
73
73
*/
74
74
const findTextEditor = ( filePath ) => {
75
75
const allEditors = atom . workspace . getTextEditors ( ) ;
76
- const matchingEditor = allEditors . find (
77
- textEditor => textEditor . getPath ( ) === filePath ) ;
76
+ const matchingEditor = allEditors . find ( textEditor => textEditor . getPath ( ) === filePath ) ;
78
77
return matchingEditor || false ;
79
78
} ;
80
79
@@ -97,38 +96,24 @@ export default {
97
96
atom . config . observe ( 'linter-clang.executablePath' , ( value ) => {
98
97
this . executablePath = value ;
99
98
} ) ,
100
- ) ;
101
- this . subscriptions . add (
102
99
atom . config . observe ( 'linter-clang.clangIncludePaths' , ( value ) => {
103
100
this . clangIncludePaths = value ;
104
101
} ) ,
105
- ) ;
106
- this . subscriptions . add (
107
102
atom . config . observe ( 'linter-clang.clangSuppressWarnings' , ( value ) => {
108
103
this . clangSuppressWarnings = value ;
109
104
} ) ,
110
- ) ;
111
- this . subscriptions . add (
112
105
atom . config . observe ( 'linter-clang.clangDefaultCFlags' , ( value ) => {
113
106
this . clangDefaultCFlags = value ;
114
107
} ) ,
115
- ) ;
116
- this . subscriptions . add (
117
108
atom . config . observe ( 'linter-clang.clangDefaultCppFlags' , ( value ) => {
118
109
this . clangDefaultCppFlags = value ;
119
110
} ) ,
120
- ) ;
121
- this . subscriptions . add (
122
111
atom . config . observe ( 'linter-clang.clangDefaultObjCFlags' , ( value ) => {
123
112
this . clangDefaultObjCFlags = value ;
124
113
} ) ,
125
- ) ;
126
- this . subscriptions . add (
127
114
atom . config . observe ( 'linter-clang.clangDefaultObjCppFlags' , ( value ) => {
128
115
this . clangDefaultObjCppFlags = value ;
129
116
} ) ,
130
- ) ;
131
- this . subscriptions . add (
132
117
atom . config . observe ( 'linter-clang.clangErrorLimit' , ( value ) => {
133
118
this . clangErrorLimit = value ;
134
119
} ) ,
@@ -210,9 +195,7 @@ export default {
210
195
args . push ( '--verbose' ) ;
211
196
}
212
197
213
- this . clangIncludePaths . forEach ( path =>
214
- args . push ( `-I${ path } ` ) ,
215
- ) ;
198
+ this . clangIncludePaths . forEach ( path => args . push ( `-I${ path } ` ) ) ;
216
199
217
200
let usingClangComplete = false ;
218
201
try {
@@ -222,7 +205,7 @@ export default {
222
205
usingClangComplete = true ;
223
206
const workingDir = / - w o r k i n g - d i r e c t o r y = ( .+ ) / . exec ( flag ) ;
224
207
if ( workingDir !== null ) {
225
- basePath = workingDir [ 1 ] ;
208
+ [ , basePath ] = workingDir ;
226
209
}
227
210
} ) ;
228
211
} catch ( error ) {
@@ -269,7 +252,7 @@ export default {
269
252
if ( isCurrentFile ) {
270
253
file = filePath ;
271
254
} else if ( isAbsolute ( match [ 1 ] ) ) {
272
- file = match [ 1 ] ;
255
+ [ , file ] = match ;
273
256
} else {
274
257
file = resolve ( basePath , match [ 1 ] ) ;
275
258
}
@@ -300,6 +283,7 @@ export default {
300
283
// There is a -Wflag specified, for now just re-insert that into the excerpt
301
284
excerpt = `${ match [ 6 ] } [${ match [ 7 ] } ]` ;
302
285
} else {
286
+ // eslint-disable-next-line prefer-destructuring
303
287
excerpt = match [ 6 ] ;
304
288
}
305
289
const message = {
0 commit comments