summaryrefslogtreecommitdiff
path: root/ale_linters/sh
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-26 21:17:47 +0100
committerw0rp <devw0rp@gmail.com>2017-10-26 21:21:42 +0100
commit33c2c20e66f694daf899963d778c47f824cda732 (patch)
tree41ce191eb81a8719f876bbc75dd6f286c311b3a3 /ale_linters/sh
parent3ac92ea529e41fa733647692e40b6ee5c0622e1d (diff)
downloadale-33c2c20e66f694daf899963d778c47f824cda732.zip
Fix #1051 - Support ash and dash for shellcheck and the sh linter
Diffstat (limited to 'ale_linters/sh')
-rw-r--r--ale_linters/sh/shellcheck.vim11
1 files changed, 8 insertions, 3 deletions
diff --git a/ale_linters/sh/shellcheck.vim b/ale_linters/sh/shellcheck.vim
index 68844a05..32b47e22 100644
--- a/ale_linters/sh/shellcheck.vim
+++ b/ale_linters/sh/shellcheck.vim
@@ -23,15 +23,20 @@ function! ale_linters#sh#shellcheck#GetDialectArgument(buffer) abort
let l:shell_type = ale#handlers#sh#GetShellType(a:buffer)
if !empty(l:shell_type)
+ " Use the dash dialect for /bin/ash, etc.
+ if l:shell_type is# 'ash'
+ return 'dash'
+ endif
+
return l:shell_type
endif
" If there's no hashbang, try using Vim's buffer variables.
- if get(b:, 'is_bash')
+ if getbufvar(a:buffer, 'is_bash', 0)
return 'bash'
- elseif get(b:, 'is_sh')
+ elseif getbufvar(a:buffer, 'is_sh', 0)
return 'sh'
- elseif get(b:, 'is_kornshell')
+ elseif getbufvar(a:buffer, 'is_kornshell', 0)
return 'ksh'
endif