Reuse ale#fixers#jq#GetExecutable for jq
This commit is contained in:
parent
98caa19cc7
commit
27130efc65
1 changed files with 2 additions and 4 deletions
|
@ -1,9 +1,7 @@
|
||||||
" Author: jD91mZM2 <me@krake.one>
|
" Author: jD91mZM2 <me@krake.one>
|
||||||
|
|
||||||
call ale#Set('json_jq_executable', 'jq')
|
|
||||||
|
|
||||||
function! ale_linters#json#jq#GetCommand(buffer) abort
|
function! ale_linters#json#jq#GetCommand(buffer) abort
|
||||||
let l:executable = ale#Var(a:buffer, 'json_jq_executable')
|
let l:executable = ale#fixers#jq#GetExecutable(a:buffer)
|
||||||
|
|
||||||
return ale#Escape(l:executable)
|
return ale#Escape(l:executable)
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -27,7 +25,7 @@ endfunction
|
||||||
|
|
||||||
call ale#linter#Define('json', {
|
call ale#linter#Define('json', {
|
||||||
\ 'name': 'jq',
|
\ 'name': 'jq',
|
||||||
\ 'executable': { b -> ale#Var(b, 'json_jq_executable') },
|
\ 'executable': function('ale#fixers#jq#GetExecutable'),
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'command': function('ale_linters#json#jq#GetCommand'),
|
\ 'command': function('ale_linters#json#jq#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#json#jq#Handle',
|
\ 'callback': 'ale_linters#json#jq#Handle',
|
||||||
|
|
Reference in a new issue