bashate.vim 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. "============================================================================
  2. "File: bashate.vim
  3. "Description: Bash script style checking plugin for syntastic.vim
  4. "License: This program is free software. It comes without any warranty,
  5. " to the extent permitted by applicable law. You can redistribute
  6. " it and/or modify it under the terms of the Do What The Fuck You
  7. " Want To Public License, Version 2, as published by Sam Hocevar.
  8. " See http://sam.zoy.org/wtfpl/COPYING for more details.
  9. "
  10. "============================================================================
  11. if exists('g:loaded_syntastic_sh_bashate_checker')
  12. finish
  13. endif
  14. let g:loaded_syntastic_sh_bashate_checker = 1
  15. let s:save_cpo = &cpo
  16. set cpo&vim
  17. function! SyntaxCheckers_sh_bashate_GetLocList() dict
  18. let makeprg = self.makeprgBuild({})
  19. let errorformat =
  20. \ '%EE%n: %m,' .
  21. \ '%Z - %f%\s%\+: L%l,' .
  22. \ '%-G%.%#'
  23. let loclist = SyntasticMake({
  24. \ 'makeprg': makeprg,
  25. \ 'errorformat': errorformat,
  26. \ 'subtype': 'Style',
  27. \ 'returns': [0, 1] })
  28. for e in loclist
  29. let e['text'] = substitute(e['text'], "\\m: '.*", '', '')
  30. endfor
  31. return loclist
  32. endfunction
  33. call g:SyntasticRegistry.CreateAndRegisterChecker({
  34. \ 'filetype': 'sh',
  35. \ 'name': 'bashate' })
  36. let &cpo = s:save_cpo
  37. unlet s:save_cpo
  38. " vim: set sw=4 sts=4 et fdm=marker: