2013-03-23 01:30:26 +01:00
|
|
|
"============================================================================
|
2013-03-26 00:40:50 +01: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-23 01:30:26 +01:00
|
|
|
"============================================================================
|
|
|
|
|
|
|
|
if exists("g:loaded_syntastic_sh_checkbashisms_checker")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let g:loaded_syntastic_sh_checkbashisms_checker=1
|
|
|
|
|
|
|
|
|
|
|
|
function! SyntaxCheckers_sh_checkbashisms_IsAvailable()
|
2013-03-26 22:42:43 +02:00
|
|
|
return executable('checkbashisms')
|
2013-03-23 01:30:26 +01:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
|
|
function! SyntaxCheckers_sh_checkbashisms_GetLocList()
|
2013-03-26 22:42:43 +02:00
|
|
|
let makeprg = syntastic#makeprg#build({
|
|
|
|
\ 'exe': 'checkbashisms',
|
2013-05-12 16:51:38 +03:00
|
|
|
\ 'args': '-fx',
|
2013-05-31 21:05:45 +03:00
|
|
|
\ 'filetype': 'sh',
|
2013-03-26 22:42:43 +02:00
|
|
|
\ 'subchecker': 'checkbashisms'})
|
2013-03-23 01:30:26 +01:00
|
|
|
|
2013-03-26 19:52:40 +00:00
|
|
|
let errorformat =
|
2013-04-30 00:16:15 +03:00
|
|
|
\ '%-Gscript %f is already a bash script; skipping,' .
|
2013-04-10 18:55:30 +03:00
|
|
|
\ '%Eerror: %f: %m\, opened in line %l,' .
|
2013-03-26 00:40:50 +01:00
|
|
|
\ '%Eerror: %f: %m,' .
|
|
|
|
\ '%Ecannot open script %f for reading: %m,' .
|
|
|
|
\ '%Wscript %f %m,%C%.# lines,' .
|
2013-04-10 23:02:03 +03:00
|
|
|
\ '%Wpossible bashism in %f line %l (%m):,%C%.%#,%Z.%#,' .
|
|
|
|
\ '%-G%.%#'
|
2013-03-23 01:30:26 +01:00
|
|
|
|
2013-05-31 21:05:45 +03:00
|
|
|
return SyntasticMake({
|
|
|
|
\ 'makeprg': makeprg,
|
|
|
|
\ 'errorformat': errorformat,
|
2013-10-23 12:59:23 +03:00
|
|
|
\ 'subtype': 'Style' })
|
2013-03-23 01:30:26 +01:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
|
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
|
|
|
\ 'filetype': 'sh',
|
2013-10-23 12:59:23 +03:00
|
|
|
\ 'name': 'checkbashisms' })
|