summaryrefslogtreecommitdiff
path: root/ale_linters/sh
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-01-22 14:54:57 +0000
committerw0rp <devw0rp@gmail.com>2017-01-22 14:54:57 +0000
commitd7ed49f84964aebdaa180b553e83943cd85c5d20 (patch)
treefc71c3fb869ca67864a32d4513cb27f25ce50f69 /ale_linters/sh
parente4a4fcd26bff47b3611887167a0510a5e29cbe3b (diff)
downloadale-d7ed49f84964aebdaa180b553e83943cd85c5d20.zip
Add a script for custom checks to enforce using the abort flag for functions and trailing whitespace, and fix existing issues.
Diffstat (limited to 'ale_linters/sh')
-rw-r--r--ale_linters/sh/shell.vim6
-rw-r--r--ale_linters/sh/shellcheck.vim4
2 files changed, 5 insertions, 5 deletions
diff --git a/ale_linters/sh/shell.vim b/ale_linters/sh/shell.vim
index f996f7e1..786cc0e6 100644
--- a/ale_linters/sh/shell.vim
+++ b/ale_linters/sh/shell.vim
@@ -11,7 +11,7 @@ if !exists('g:ale_linters_sh_shell_default_shell')
endif
endif
-function! ale_linters#sh#shell#GetExecutable(buffer)
+function! ale_linters#sh#shell#GetExecutable(buffer) abort
let l:banglines = getbufline(a:buffer, 1)
" Take the shell executable from the hashbang, if we can.
@@ -29,11 +29,11 @@ function! ale_linters#sh#shell#GetExecutable(buffer)
return g:ale_linters_sh_shell_default_shell
endfunction
-function! ale_linters#sh#shell#GetCommand(buffer)
+function! ale_linters#sh#shell#GetCommand(buffer) abort
return ale_linters#sh#shell#GetExecutable(a:buffer) . ' -n'
endfunction
-function! ale_linters#sh#shell#Handle(buffer, lines)
+function! ale_linters#sh#shell#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" bash: line 13: syntax error near unexpected token `d'
diff --git a/ale_linters/sh/shellcheck.vim b/ale_linters/sh/shellcheck.vim
index d0fe8b11..735a0cd3 100644
--- a/ale_linters/sh/shellcheck.vim
+++ b/ale_linters/sh/shellcheck.vim
@@ -16,7 +16,7 @@ else
let s:exclude_option = ''
endif
-function! s:GetDialectArgument()
+function! s:GetDialectArgument() abort
if exists('b:is_bash') && b:is_bash
return '-s bash'
elseif exists('b:is_sh') && b:is_sh
@@ -28,7 +28,7 @@ function! s:GetDialectArgument()
return ''
endfunction
-function! ale_linters#sh#shellcheck#GetCommand(buffer)
+function! ale_linters#sh#shellcheck#GetCommand(buffer) abort
return 'shellcheck ' . s:exclude_option . ' ' . s:GetDialectArgument() . ' -f gcc -'
endfunction