2018-01-28 06:51:20 -05:00
|
|
|
Before:
|
|
|
|
Save g:ale_json_jq_executable
|
|
|
|
Save g:ale_json_jq_options
|
2018-10-12 04:15:32 -04:00
|
|
|
Save g:ale_json_jq_filters
|
2018-01-28 06:51:20 -05:00
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
|
|
|
Execute(The jq fixer should use the options you set):
|
|
|
|
let g:ale_json_jq_executable = 'foo'
|
|
|
|
let g:ale_json_jq_options = '--bar'
|
2018-10-12 04:15:32 -04:00
|
|
|
let g:ale_json_jq_filters = '.baz'
|
2018-01-28 06:51:20 -05:00
|
|
|
|
|
|
|
AssertEqual
|
2018-10-12 04:15:32 -04:00
|
|
|
\ {'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,
|
2018-01-28 06:51:20 -05:00
|
|
|
\ ale#fixers#jq#Fix(bufnr(''))
|