Available hooks:
- post-checkout
- pre-commit
If you want to install the hooks for each new git-repo you create you can install them globally:
git clone https://github.com/sumocoders/hooks.git .
cp post-checkout ~/.git_template/hooks/post-checkout
chmod +x ~/.git_template/hooks/post-checkout
cp pre-commit ~/.git_template/hooks/pre-commit
chmod +x ~/.git_template/hooks/pre-commit
The post-checkout hook will check if you have a Procfile, and if so it will ask you if the Procfile should be executed. If there is no Procfile it will search for compass-files and compile them.
curl -O https://raw.githubusercontent.com/sumocoders/hooks/master/post-checkout
mv pre-commit .git/hooks/post-checkout
chmod +x .git/hooks/post-checkout
The pre-commit hook will check the files that will be commited, the checks are
managed in our sumo hook check
commando.
This hook has some dependencies:
- Make sure sumodev is installed
- Make sure php is available
- Make sure phpcs is installed, see http://pear.php.net/package/PHP_CodeSniffer
- Make sure csslint is installed, see https://github.com/stubbornella/csslint/wiki/Command-line-interface
- Make sure scss-lint is installed, see https://github.com/causes/scss-lint
- Make sure esvalidate is installed, see https://github.com/duereg/esvalidate
curl -O https://raw.githubusercontent.com/sumocoders/hooks/master/pre-commit
mv pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit