Fix #491 - Use -x for shellcheck for checking files with sourced files

This commit is contained in:
w0rp
2017-10-26 00:48:51 +01:00
parent 2f5b94e07d
commit 5917de565d
2 changed files with 20 additions and 7 deletions

View File

@@ -43,11 +43,12 @@ function! ale_linters#sh#shellcheck#GetCommand(buffer) abort
let l:exclude_option = ale#Var(a:buffer, 'sh_shellcheck_exclusions')
let l:dialect = ale_linters#sh#shellcheck#GetDialectArgument(a:buffer)
return ale_linters#sh#shellcheck#GetExecutable(a:buffer)
return ale#path#BufferCdString(a:buffer)
\ . ale#Escape(ale_linters#sh#shellcheck#GetExecutable(a:buffer))
\ . (!empty(l:dialect) ? ' -s ' . l:dialect : '')
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '')
\ . ' -f gcc -'
\ . ' -x -f gcc -'
endfunction
call ale#linter#Define('sh', {