syntastic/syntax_checkers/sh/checkbashisms.vim

36 lines
1.2 KiB
VimL
Raw Normal View History

2013-03-22 20:30:26 -04:00
"============================================================================
"File: checkbashisms.vim
"Description: Shell script syntax/style checking plugin for syntastic.vim
"Notes: checkbashisms.pl can be downloaded from
" http://debian.inode.at/debian/pool/main/d/devscripts/
" as part of the devscripts package.
2013-03-22 20:30:26 -04:00
"============================================================================
if exists("g:loaded_syntastic_sh_checkbashisms_checker")
finish
endif
let g:loaded_syntastic_sh_checkbashisms_checker=1
function! SyntaxCheckers_sh_checkbashisms_IsAvailable()
return executable('checkbashisms.pl')
2013-03-22 20:30:26 -04:00
endfunction
function! SyntaxCheckers_sh_checkbashisms_GetLocList()
let l:makeprg = syntastic#makeprg#build({'exe': 'checkbashisms.pl', 'args': '-fpx'})
2013-03-22 20:30:26 -04:00
let l:errorformat =
\ '%Eerror: %f: %m,' .
\ '%Ecannot open script %f for reading: %m,' .
\ '%Wscript %f %m,%C%.# lines,' .
\ '%Wpossible bashism in %f line %l (%m):,%C%.%#,%Z.%#'
2013-03-22 20:30:26 -04:00
return SyntasticMake({'makeprg': l:makeprg, 'errorformat': l:errorformat})
2013-03-22 20:30:26 -04:00
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'sh',
\ 'name': 'checkbashisms'})