mirror of
https://github.com/dense-analysis/ale.git
synced 2026-10-07 20:54:34 +08:00
Add jq as a JSON fixer
This commit is contained in:
1 parent
038789f0ed
commit
d562d53102
5 files changed
+53
-2
No files matched your search
@@ -0,0 +1,18 @@
|
||||
call ale#Set('json_jq_executable', 'jq')
|
||||
call ale#Set('json_jq_use_global', 0)
|
||||
call ale#Set('json_jq_options', '')
|
||||
|
||||
function! ale#fixers#jq#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'jq', [
|
||||
\ 'jq',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#jq#Fix(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'json_jq_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#fixers#jq#GetExecutable(a:buffer))
|
||||
\ . ' . ' . l:options,
|
||||
\}
|
||||
endfunction
|
||||
Reference in new issue
Block a user