juizmill / git-hooks
Git Hooks
2.0.3
2016-12-07 19:50 UTC
Requires
- friendsofphp/php-cs-fixer: v1.12.4
- phpmd/phpmd: ^2.2
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ^2.3
- symfony/process: v3.*
README
Checks list
- Syntax check with php lint (“php -l”): We check every committed file has a valid PHP syntax.
- Sync check of composer.json and composer.lock files: We check these two files are committed together in order to avoid committing the json but not the lock and generate some issue to another developers.
- PHP CS Fixer check: With the –dry-run parameter it does not fix, just say what the problems are. With the –fixers parameter you can control what fixers you want to execute.
- PHP Code Sniffer check: Same as before, but another rule that checks another rules.
- PHPMD: We have enabled the controversial rules.
- Unit Testing check: We run around 3.000 tests right now.
INSTALLATION:
The recommended way to install this library is through Composer:
add juizmill/git-hooks
as a composer dependency.
composer.json
"require-dev": { ... "juizmill/git-hooks": "dev-master" }
php composer.phar update juizmill/git-hooks
USAGE:
When a developer clones the project, it just needs to:
Edit composer.json and add:
"scripts": {
"pre-update-cmd": "GitHooks\\Composer\\Script\\Hooks::preHooks",
"pre-install-cmd": "GitHooks\\Composer\\Script\\Hooks::preHooks",
"post-update-cmd": "GitHooks\\Composer\\Script\\Hooks::postHooks",
"post-install-cmd": "GitHooks\\Composer\\Script\\Hooks::postHooks"
}
Remembering to set up the hooks
Custom config
Copy arquives vendor/juizmill/git-hooks/config/*
to [project]