summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorHenrique Barcelos <16565602+hbarcelos@users.noreply.github.com>2022-07-02 10:05:03 -0300
committerGitHub <noreply@github.com>2022-07-02 22:05:03 +0900
commitd6f3d4976d21e516193da5907db3f06e56d3e5c8 (patch)
treee183f9f916b19ec561a69e0018178789216312bb /test/fixers
parent16cca1413f6492a2bec1c036f1a0aa66c8219b34 (diff)
downloadale-d6f3d4976d21e516193da5907db3f06e56d3e5c8.zip
Allow `shfmt` fixer to use `.editorconfig` (#4244)
* fix: added support for local solhint executable * feat: added support for matching parse errors * test: added test for solhint command callback and handler * chore: removed command callback test * refactor: made solhint handler structure closer to eslint * refactor(shfmt-fixer): remove derivation of default CLI arguments
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_shfmt_fixer_callback.vader34
1 files changed, 1 insertions, 33 deletions
diff --git a/test/fixers/test_shfmt_fixer_callback.vader b/test/fixers/test_shfmt_fixer_callback.vader
index 99cb0987..02fce526 100644
--- a/test/fixers/test_shfmt_fixer_callback.vader
+++ b/test/fixers/test_shfmt_fixer_callback.vader
@@ -14,39 +14,6 @@ Execute(The shfmt callback should return 'shfmt' as default command):
\ ale#fixers#shfmt#Fix(bufnr('')).command =~# '^' . ale#Escape('shfmt'),
\ "Default command name is expected to be 'shfmt'"
-Execute(The shfmt callback should return the command with no option as default when noexpandtab is set):
- let g:ale_sh_shfmt_executable = 'shfmt'
- let g:ale_sh_shfmt_options = ''
- setlocal noexpandtab
- AssertEqual
- \ {
- \ 'command': ale#Escape('shfmt'),
- \ },
- \ ale#fixers#shfmt#Fix(bufnr(''))
-
-Execute(The shfmt callback should return the command specifying indent width by looking shiftwidth as default):
- let g:ale_sh_shfmt_executable = 'shfmt'
- let g:ale_sh_shfmt_options = ''
- setlocal expandtab
- setlocal shiftwidth=4
- AssertEqual
- \ {
- \ 'command': ale#Escape('shfmt') . ' -i 4',
- \ },
- \ ale#fixers#shfmt#Fix(bufnr(''))
-
-Execute(The shfmt callback should return the command specifying indent width by looking tabstop when shiftwidth is 0 as default):
- let g:ale_sh_shfmt_executable = 'shfmt'
- let g:ale_sh_shfmt_options = ''
- setlocal expandtab
- setlocal shiftwidth=0
- setlocal tabstop=8
- AssertEqual
- \ {
- \ 'command': ale#Escape('shfmt') . ' -i 8',
- \ },
- \ ale#fixers#shfmt#Fix(bufnr(''))
-
Execute(The shfmt executable and options should be configurable):
let g:ale_sh_shfmt_executable = 'foobar'
let g:ale_sh_shfmt_options = '--some-option'
@@ -54,6 +21,7 @@ Execute(The shfmt executable and options should be configurable):
AssertEqual
\ {
\ 'command': ale#Escape('foobar')
+ \ . ' -filename=%s'
\ . ' --some-option',
\ },
\ ale#fixers#shfmt#Fix(bufnr(''))