diff options
author | Aliou Diallo <aliou@users.noreply.github.com> | 2018-10-12 10:15:32 +0200 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2018-10-12 09:15:32 +0100 |
commit | b7ec11c93d12ce8f64cfdae363cbab3d2e69dfd4 (patch) | |
tree | b7c134db03184b1ff2c8df98fa4876508e202420 /test | |
parent | e5b5ce9f512d4a36e944f728f4d1ff5d8238c64f (diff) | |
download | ale-b7ec11c93d12ce8f64cfdae363cbab3d2e69dfd4.zip |
Allow custom filters for the jq fixer (#1980)
* Allow the jq filters to receive custom filters.
* Update documentation.
Diffstat (limited to 'test')
-rw-r--r-- | test/fixers/test_jq_fixer_callback.vader | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/fixers/test_jq_fixer_callback.vader b/test/fixers/test_jq_fixer_callback.vader index 2e32bf8e..74580d3b 100644 --- a/test/fixers/test_jq_fixer_callback.vader +++ b/test/fixers/test_jq_fixer_callback.vader @@ -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('')) |