This script checks the following, before committing code to a chef server that might cause it to break, die, or otherwise be sad:
knife cookbook test
- Ruby and ERB template syntax.tailor
- Ruby style conventionsfoodcritic
- Chef cookbook linting toolA fork of Doug Ireton
You must put a file called pre-commit
in $REPO/.git/hooks/
of the
repository you want this script to run on.
# Install Prerequsities
$ gem install tailor
$ gem install foodcritic
# Checkout code
$ cd ~/repos
$ git clone git@github.com:mburns/chef-pre-commit-hook.git
# Symlink (or copy) the pre-commit file to .git/hooks/pre-commit in your chef repository
$ ln -s ~/repos/chef-pre-commit-hook/pre-commit ~/repos/chef-repo/.git/hooks/pre-commit