code-ayatollah.vim 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. "============================================================================
  2. "File: code-ayatollah.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. "============================================================================
  12. if exists('g:loaded_syntastic_racket_code_ayatollah_checker')
  13. finish
  14. endif
  15. let g:loaded_syntastic_racket_code_ayatollah_checker = 1
  16. if !exists('g:syntastic_racket_code_ayatollah_script')
  17. let g:syntastic_racket_code_ayatollah_script = 'code-ayatollah.rkt'
  18. endif
  19. if !exists('g:syntastic_racket_code_ayatollah_sort')
  20. let g:syntastic_racket_code_ayatollah_sort = 1
  21. endif
  22. let s:save_cpo = &cpo
  23. set cpo&vim
  24. function! SyntaxCheckers_racket_code_ayatollah_IsAvailable() dict
  25. let s:script = expand(g:syntastic_racket_code_ayatollah_script, 1)
  26. return executable(self.getExec()) && filereadable(s:script)
  27. endfunction
  28. function! SyntaxCheckers_racket_code_ayatollah_GetLocList() dict
  29. let makeprg = self.makeprgBuild({ 'exe': [self.getExec(), s:script] })
  30. let errorformat =
  31. \ ' %l:%v: %m,' .
  32. \ '%PErrors in %f:,' .
  33. \ '%-G%.%#'
  34. let loclist = SyntasticMake({
  35. \ 'makeprg': makeprg,
  36. \ 'errorformat': errorformat,
  37. \ 'subtype': 'Style' })
  38. for e in loclist
  39. let e['col'] += 1
  40. endfor
  41. return loclist
  42. endfunction
  43. call g:SyntasticRegistry.CreateAndRegisterChecker({
  44. \ 'filetype': 'racket',
  45. \ 'name': 'code_ayatollah',
  46. \ 'exec': 'racket' })
  47. let &cpo = s:save_cpo
  48. unlet s:save_cpo
  49. " vim: set sw=4 sts=4 et fdm=marker: