Vim: Check your Chef cookbooks using foodcritic
I've been using foodcritic to detect something wrong in a cookbook.
Firstly, you must install foodcritic.
gem install foodcritic
And also, you must put following code in your .vimrc.
" $HOME/.vimrc
autocmd BufRead,BufNewFile *
\ if expand('%:p:h') =~# '.*/cookbooks/.*'
\| setlocal makeprg=foodcritic\ $*\ %
\| setlocal errorformat=%m:\ %f:%l
\| endif
And then, you can use:
:make
:copen
If your cookbook has errors you will get messages in the Quickfix List:
Written by Tacahiroy
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#