Skip to content

Instantly share code, notes, and snippets.

@dougireton
Created February 8, 2013 06:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dougireton/4737060 to your computer and use it in GitHub Desktop.
Save dougireton/4737060 to your computer and use it in GitHub Desktop.
(Broken) chef Syntastic syntax checker
function! SyntaxCheckers_chef_IsAvailable()
return executable('foodcritic')
endfunction
function! SyntaxCheckers_chef_GetLocList()
" let exe = expand(g:syntastic_ruby_exec)
" if !has('win32')
" let exe = 'RUBYOPT= ' . exe
" endif
let makeprg = syntastic#makeprg#build({
\ 'exe': 'foodcritic',
\ 'args': '' })
" let errorformat = '%-G%.%#warning: %\(possibly %\)%\?useless use of == in void context'
" FC023: Prefer conditional attributes: ./recipes/config.rb:49
let errorformat = '%n: %m: %f:%l'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'chef',
\ 'name': 'chef'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment