splint.vim 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. "============================================================================
  2. "File: splint.vim
  3. "Description: Syntax checking plugin for syntastic
  4. "Maintainer: LCD 47 <lcd047 at gmail dot com>
  5. "License: This program is free software. It comes without any warranty,
  6. " to the extent permitted by applicable law. You can redistribute
  7. " it and/or modify it under the terms of the Do What The Fuck You
  8. " Want To Public License, Version 2, as published by Sam Hocevar.
  9. " See http://sam.zoy.org/wtfpl/COPYING for more details.
  10. "============================================================================
  11. if exists('g:loaded_syntastic_c_splint_checker')
  12. finish
  13. endif
  14. let g:loaded_syntastic_c_splint_checker = 1
  15. let s:save_cpo = &cpo
  16. set cpo&vim
  17. function! SyntaxCheckers_c_splint_GetLocList() dict
  18. let buf = bufnr('')
  19. let makeprg = self.makeprgBuild({
  20. \ 'args': syntastic#c#ReadConfig(syntastic#util#bufVar(buf, 'splint_config_file')),
  21. \ 'args_after': '-showfunc -hints +quiet' })
  22. let errorformat =
  23. \ '%-G%f:%l:%v: %[%#]%[%#]%[%#] Internal Bug %.%#,' .
  24. \ '%-G%f(%l\,%v): %[%#]%[%#]%[%#] Internal Bug %.%#,' .
  25. \ '%W%f:%l:%v: %m,' .
  26. \ '%W%f(%l\,%v): %m,' .
  27. \ '%W%f:%l: %m,' .
  28. \ '%W%f(%l): %m,' .
  29. \ '%-C %\+In file included from %.%#,' .
  30. \ '%-C %\+from %.%#,' .
  31. \ '%+C %.%#'
  32. return SyntasticMake({
  33. \ 'makeprg': makeprg,
  34. \ 'errorformat': errorformat,
  35. \ 'subtype': 'Style',
  36. \ 'postprocess': ['compressWhitespace'],
  37. \ 'defaults': {'type': 'W'} })
  38. endfunction
  39. call g:SyntasticRegistry.CreateAndRegisterChecker({
  40. \ 'filetype': 'c',
  41. \ 'name': 'splint'})
  42. let &cpo = s:save_cpo
  43. unlet s:save_cpo
  44. " vim: set sw=4 sts=4 et fdm=marker: