verapp.vim 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. "============================================================================
  2. "File: verapp.vim
  3. "Description: Syntax checking plugin for syntastic
  4. "Maintainer: Lucas Verney <phyks@phyks.me>
  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. " Tested with Vera++ 1.3.0
  12. "============================================================================
  13. if exists('g:loaded_syntastic_cpp_verapp_checker')
  14. finish
  15. endif
  16. let g:loaded_syntastic_cpp_verapp_checker = 1
  17. let s:save_cpo = &cpo
  18. set cpo&vim
  19. function! SyntaxCheckers_cpp_verapp_GetLocList() dict
  20. let buf = bufnr('')
  21. let makeprg = self.makeprgBuild({
  22. \ 'args': syntastic#c#ReadConfig(syntastic#util#bufVar(buf, 'verapp_config_file')),
  23. \ 'args_after': '--show-rule --no-duplicate -S -c -' })
  24. let errorformat = '%f:%t:%l:%c:%m'
  25. return SyntasticMake({
  26. \ 'makeprg': makeprg,
  27. \ 'errorformat': errorformat,
  28. \ 'preprocess': 'checkstyle',
  29. \ 'subtype': 'Style' })
  30. endfunction
  31. call g:SyntasticRegistry.CreateAndRegisterChecker({
  32. \ 'filetype': 'cpp',
  33. \ 'name': 'verapp',
  34. \ 'exec': 'vera++'})
  35. let &cpo = s:save_cpo
  36. unlet s:save_cpo
  37. " vim: set sw=4 sts=4 et fdm=marker: