splint.vim 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. "============================================================================
  2. "File: splint.vim
  3. "Description: Syntax checking plugin for syntastic.vim
  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. if !exists('g:syntastic_splint_config_file')
  16. let g:syntastic_splint_config_file = '.syntastic_splint_config'
  17. endif
  18. let s:save_cpo = &cpo
  19. set cpo&vim
  20. function! SyntaxCheckers_c_splint_GetLocList() dict
  21. let makeprg = self.makeprgBuild({
  22. \ 'args': syntastic#c#ReadConfig(g:syntastic_splint_config_file),
  23. \ 'args_after': '-showfunc -hints +quiet' })
  24. let errorformat =
  25. \ '%-G%f:%l:%v: %[%#]%[%#]%[%#] Internal Bug %.%#,' .
  26. \ '%-G%f(%l\,%v): %[%#]%[%#]%[%#] Internal Bug %.%#,' .
  27. \ '%W%f:%l:%v: %m,' .
  28. \ '%W%f(%l\,%v): %m,' .
  29. \ '%W%f:%l: %m,' .
  30. \ '%W%f(%l): %m,' .
  31. \ '%-C %\+In file included from %.%#,' .
  32. \ '%-C %\+from %.%#,' .
  33. \ '%+C %.%#'
  34. return SyntasticMake({
  35. \ 'makeprg': makeprg,
  36. \ 'errorformat': errorformat,
  37. \ 'subtype': 'Style',
  38. \ 'postprocess': ['compressWhitespace'],
  39. \ 'defaults': {'type': 'W'} })
  40. endfunction
  41. call g:SyntasticRegistry.CreateAndRegisterChecker({
  42. \ 'filetype': 'c',
  43. \ 'name': 'splint'})
  44. let &cpo = s:save_cpo
  45. unlet s:save_cpo
  46. " vim: set sw=4 sts=4 et fdm=marker: