CaptainHook repository instead.
WARNING: This repository and package is abandoned, please use the officialInstall official version
Use Composer to install CaptainHook.
$ composer require --dev captainhook/captainhook
After installing CaptainHook you can use the captainhook executable to create a configuration.
$ vendor/bin/captainhook configure
Now there should be a captainhook.json configuration file. To finally activate the hooks you have to install them to your local .git repository. You can install the .git hooks by running the following captainhook command.
$ vendor/bin/captainhook install
Have a look at this short installation video.
Configuration
Here's an example captainhook.json configuration file.
{
"commit-msg": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\Message\\Action\\Beams",
"options": []
}
]
},
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "phpunit"
},
{
"action": "phpcs --standard=psr2 src"
}
]
},
"pre-push": {
"enabled": false,
"actions": []
}
}