mirror of https://github.com/dense-analysis/ale
Move dialect setting before user options (shellcheck)
This commit is contained in:
parent
70fdeb7c22
commit
3910b025b2
|
@ -44,9 +44,9 @@ function! ale_linters#sh#shellcheck#GetCommand(buffer) abort
|
||||||
let l:dialect = ale_linters#sh#shellcheck#GetDialectArgument(a:buffer)
|
let l:dialect = ale_linters#sh#shellcheck#GetDialectArgument(a:buffer)
|
||||||
|
|
||||||
return ale_linters#sh#shellcheck#GetExecutable(a:buffer)
|
return ale_linters#sh#shellcheck#GetExecutable(a:buffer)
|
||||||
|
\ . (!empty(l:dialect) ? ' -s ' . l:dialect : '')
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '')
|
\ . (!empty(l:exclude_option) ? ' -e ' . l:exclude_option : '')
|
||||||
\ . (!empty(l:dialect) ? ' -s ' . l:dialect : '')
|
|
||||||
\ . ' -f gcc -'
|
\ . ' -f gcc -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
|
@ -45,3 +45,12 @@ Execute(The shellcheck command should include the dialect):
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ 'shellcheck -s bash -f gcc -',
|
\ 'shellcheck -s bash -f gcc -',
|
||||||
\ ale_linters#sh#shellcheck#GetCommand(bufnr(''))
|
\ ale_linters#sh#shellcheck#GetCommand(bufnr(''))
|
||||||
|
|
||||||
|
Execute(The shellcheck command should include the dialect before options and exclusions):
|
||||||
|
let b:is_bash = 1
|
||||||
|
let b:ale_sh_shellcheck_options = '--foobar'
|
||||||
|
let b:ale_sh_shellcheck_exclusions = 'foo,bar'
|
||||||
|
|
||||||
|
AssertEqual
|
||||||
|
\ 'shellcheck -s bash --foobar -e foo,bar -f gcc -',
|
||||||
|
\ ale_linters#sh#shellcheck#GetCommand(bufnr(''))
|
||||||
|
|
Loading…
Reference in New Issue