summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/sh/shell.vim15
-rw-r--r--ale_linters/sh/shellcheck.vim9
2 files changed, 14 insertions, 10 deletions
diff --git a/ale_linters/sh/shell.vim b/ale_linters/sh/shell.vim
index cd363091..3b017b0e 100644
--- a/ale_linters/sh/shell.vim
+++ b/ale_linters/sh/shell.vim
@@ -1,13 +1,18 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: Lints sh files using bash -n
+" Backwards compatibility
+if exists('g:ale_linters_sh_shell_default_shell')
+ let g:ale_sh_shell_default_shell = g:ale_linters_sh_shell_default_shell
+endif
+
" This option can be changed to change the default shell when the shell
" cannot be taken from the hashbang line.
-if !exists('g:ale_linters_sh_shell_default_shell')
- let g:ale_linters_sh_shell_default_shell = fnamemodify($SHELL, ':t')
+if !exists('g:ale_sh_shell_default_shell')
+ let g:ale_sh_shell_default_shell = fnamemodify($SHELL, ':t')
- if g:ale_linters_sh_shell_default_shell ==# ''
- let g:ale_linters_sh_shell_default_shell = 'bash'
+ if g:ale_sh_shell_default_shell ==# ''
+ let g:ale_sh_shell_default_shell = 'bash'
endif
endif
@@ -26,7 +31,7 @@ function! ale_linters#sh#shell#GetExecutable(buffer) abort
endfor
endif
- return ale#Var(a:buffer, 'linters_sh_shell_default_shell')
+ return ale#Var(a:buffer, 'sh_shell_default_shell')
endfunction
function! ale_linters#sh#shell#GetCommand(buffer) abort
diff --git a/ale_linters/sh/shellcheck.vim b/ale_linters/sh/shellcheck.vim
index b4a622a0..5353683d 100644
--- a/ale_linters/sh/shellcheck.vim
+++ b/ale_linters/sh/shellcheck.vim
@@ -5,10 +5,9 @@
" This global variable can be set with a string of comma-seperated error
" codes to exclude from shellcheck. For example:
"
-" let g:ale_linters_sh_shellcheck_exclusions = 'SC2002,SC2004'
-if !exists('g:ale_linters_sh_shellcheck_exclusions')
- let g:ale_linters_sh_shellcheck_exclusions = ''
-endif
+" let g:ale_sh_shellcheck_exclusions = 'SC2002,SC2004'
+let g:ale_sh_shellcheck_exclusions =
+\ get(g:, 'ale_sh_shellcheck_exclusions', get(g:, 'ale_linters_sh_shellcheck_exclusions', ''))
let g:ale_sh_shellcheck_executable =
\ get(g:, 'ale_sh_shellcheck_executable', 'shellcheck')
@@ -33,7 +32,7 @@ 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')
+ let l:exclude_option = ale#Var(a:buffer, 'sh_shellcheck_exclusions')
return ale_linters#sh#shellcheck#GetExecutable(a:buffer)
\ . ' ' . ale#Var(a:buffer, 'sh_shellcheck_options')