mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-09 22:14:44 +08:00
Allow custom filters for the jq fixer (#1980)
* Allow the jq filters to receive custom filters. * Update documentation.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
Before:
|
||||
Save g:ale_json_jq_executable
|
||||
Save g:ale_json_jq_options
|
||||
Save g:ale_json_jq_filters
|
||||
|
||||
After:
|
||||
Restore
|
||||
@@ -8,7 +9,18 @@ After:
|
||||
Execute(The jq fixer should use the options you set):
|
||||
let g:ale_json_jq_executable = 'foo'
|
||||
let g:ale_json_jq_options = '--bar'
|
||||
let g:ale_json_jq_filters = '.baz'
|
||||
|
||||
AssertEqual
|
||||
\ {'command': ale#Escape('foo') . ' . --bar'},
|
||||
\ {'command': ale#Escape('foo') . ' .baz --bar'},
|
||||
\ ale#fixers#jq#Fix(bufnr(''))
|
||||
|
||||
Execute(The jq fixer should return 0 when there are no filters):
|
||||
let g:ale_json_jq_executable = 'jq'
|
||||
let g:ale_json_jq_options = ''
|
||||
|
||||
let g:ale_json_jq_filters = ''
|
||||
|
||||
AssertEqual
|
||||
\ 0,
|
||||
\ ale#fixers#jq#Fix(bufnr(''))
|
||||
|
||||
Reference in New Issue
Block a user