agentsquidflaps / pre-commit
Automate code standards on commit
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Shell
Type:scripts
Requires
- squizlabs/php_codesniffer: ^2.7 || ^3.0
This package is auto-updated.
Last update: 2024-11-08 20:07:23 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.