summaryrefslogtreecommitdiff
path: root/ale_linters/sh
diff options
context:
space:
mode:
authorAdriaan Zonnenberg <amz@adriaan.xyz>2017-04-28 00:01:01 +0200
committerAdriaan Zonnenberg <amz@adriaan.xyz>2017-04-28 00:01:01 +0200
commit7230cbe9e43d64a02212ae4803abff874e39b8d6 (patch)
tree251dfe5284bd59122a683d844559be9f4b93e50b /ale_linters/sh
parentba6dbde906a297dbb95d350f9cddfbc00f1070a5 (diff)
downloadale-7230cbe9e43d64a02212ae4803abff874e39b8d6.zip
Use ale#Var in linters that didn't use it yet
Diffstat (limited to 'ale_linters/sh')
-rw-r--r--ale_linters/sh/shellcheck.vim11
1 files changed, 4 insertions, 7 deletions
diff --git a/ale_linters/sh/shellcheck.vim b/ale_linters/sh/shellcheck.vim
index 1d9f7b05..b4a622a0 100644
--- a/ale_linters/sh/shellcheck.vim
+++ b/ale_linters/sh/shellcheck.vim
@@ -20,12 +20,6 @@ function! ale_linters#sh#shellcheck#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'sh_shellcheck_executable')
endfunction
-if g:ale_linters_sh_shellcheck_exclusions !=# ''
- let s:exclude_option = '-e ' . g:ale_linters_sh_shellcheck_exclusions
-else
- let s:exclude_option = ''
-endif
-
function! s:GetDialectArgument() abort
if exists('b:is_bash') && b:is_bash
return '-s bash'
@@ -39,9 +33,12 @@ function! s:GetDialectArgument() abort
endfunction
function! ale_linters#sh#shellcheck#GetCommand(buffer) abort
+ let l:exclude_option = ale#Var(a:buffer, 'linters_sh_shellcheck_exclusions')
+
return ale_linters#sh#shellcheck#GetExecutable(a:buffer)
\ . ' ' . ale#Var(a:buffer, 'sh_shellcheck_options')
- \ . ' ' . s:exclude_option . ' ' . s:GetDialectArgument() . ' -f gcc -'
+ \ . ' ' . (!empty(l:exclude_option) ? '-e ' . l:exclude_option : '')
+ \ . ' ' . s:GetDialectArgument() . ' -f gcc -'
endfunction
call ale#linter#Define('sh', {