aboutsummaryrefslogtreecommitdiff
path: root/vim/compiler/shellcheck.vim
blob: 004ad3696e4cd1b17f86978f286c38a8365cb495 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
" :compiler support for shell script linting with ShellCheck
" <https://www.shellcheck.net/>
if exists('current_compiler') || &compatible || !has('patch-7.4.191')
  finish
endif
let current_compiler = 'shellcheck'

" Build 'makeprg' command line based on this buffer's shell script type
let s:set = 'CompilerSet makeprg=shellcheck\ -e\ SC1090\ -f\ gcc'
if exists('b:is_bash')
  let s:set = s:set . '\ -s\ bash'
elseif exists('b:is_kornshell')
  let s:set = s:set . '\ -s\ ksh'
else
  let s:set = s:set . '\ -s\ sh'
endif
execute s:set . '\ --\ %:S'

CompilerSet errorformat=%f:%l:%c:\ %m\ [SC%n]