agentsquidflaps / pre-commit
Automate code standards on commit
Package info
github.com/agentsquidflaps/pre-commit
Language:Shell
Type:scripts
pkg:composer/agentsquidflaps/pre-commit
1.0.1
2020-09-08 10:53 UTC
Requires
- squizlabs/php_codesniffer: ^2.7 || ^3.0
This package is auto-updated.
Last update: 2026-03-08 22:52:57 UTC
README
Heavily inspired by smgladkovskiy/phpcs-git-pre-commit
About
Run php linting, code beautifier and code sniffer automatically to the PS2 standard. This differs from
smgladkovskiy/phpcs-git-pre-commit only in that
it runs phpcbf in addition to phpcs.
Install
composer require --dev "agentsquidflaps/pre-commit"
To enable code sniff, аdd to post-install-cmd and post-update-cmd in composer.json installation script:
"scripts": {
"install-hooks": ["sh ./vendor/agentsquidflaps/pre-commit/src/setup.sh"],
"post-install-cmd": ["@install-hooks"],
"post-update-cmd": ["@install-hooks"]
}
Then run composer install or composer update. pre-commit hook will be installed or updated.