diff options
author | Szero <singleton@tfwno.gf> | 2017-04-09 19:54:25 +0200 |
---|---|---|
committer | Szero <singleton@tfwno.gf> | 2017-04-09 19:54:25 +0200 |
commit | 8e33abaeab5a7e796f46a8a5107eba18f7c20987 (patch) | |
tree | abd6be625d1f1c1441d24497f460fd44ecf1df36 /ale_linters/sh | |
parent | b9bb4adacda521ac98b3ed656cd328ae36835e40 (diff) | |
download | ale-8e33abaeab5a7e796f46a8a5107eba18f7c20987.zip |
added shellcheck executable and options variable
updated docs
Diffstat (limited to 'ale_linters/sh')
-rw-r--r-- | ale_linters/sh/shellcheck.vim | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ale_linters/sh/shellcheck.vim b/ale_linters/sh/shellcheck.vim index 735a0cd3..bb556460 100644 --- a/ale_linters/sh/shellcheck.vim +++ b/ale_linters/sh/shellcheck.vim @@ -10,6 +10,16 @@ if !exists('g:ale_linters_sh_shellcheck_exclusions') let g:ale_linters_sh_shellcheck_exclusions = '' endif +let g:ale_sh_shellcheck_executable = +\ get(g:, 'ale_sh_shellcheck_executable', 'shellcheck') + +let g:ale_sh_shellcheck_options = +\ get(g:, 'ale_sh_shellcheck_options', '') + +function! ale_linters#sh#shellcheck#GetExecutable(buffer) abort + return g:ale_sh_shellcheck_executable +endfunction + if g:ale_linters_sh_shellcheck_exclusions !=# '' let s:exclude_option = '-e ' . g:ale_linters_sh_shellcheck_exclusions else @@ -29,12 +39,14 @@ function! s:GetDialectArgument() abort endfunction function! ale_linters#sh#shellcheck#GetCommand(buffer) abort - return 'shellcheck ' . s:exclude_option . ' ' . s:GetDialectArgument() . ' -f gcc -' + return ale_linters#sh#shellcheck#GetExecutable(a:buffer) + \ . ' ' . g:ale_sh_shellcheck_options + \ . ' ' . s:exclude_option . ' ' . s:GetDialectArgument() . ' -f gcc -' endfunction call ale#linter#Define('sh', { \ 'name': 'shellcheck', -\ 'executable': 'shellcheck', +\ 'executable_callback': 'ale_linters#sh#shellcheck#GetExecutable', \ 'command_callback': 'ale_linters#sh#shellcheck#GetCommand', \ 'callback': 'ale#handlers#HandleGCCFormat', \}) |