Download the PHP package damien-list/phpcs-git-pre-commit without Composer
On this page you can find all versions of the php package damien-list/phpcs-git-pre-commit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download damien-list/phpcs-git-pre-commit
More information about damien-list/phpcs-git-pre-commit
Files in damien-list/phpcs-git-pre-commit
Package phpcs-git-pre-commit
Short Description PHP-CS-Fixer check before commit based on Sergey Gladkovskiy's work
License MIT
Informations about the package phpcs-git-pre-commit
PHPCS git pre-commit hook
About
Auto installed git pre-commit hook for running PHP Code Sniffer code checking to PSR2 coding standard compliance. It checks only files that are to be committed.
Inspired by Enforce code standards with composer, git hooks, and phpcs
Installation
Install damien-list/phpcs-git-pre-commit
with composer require command:
composer require "damien-list/phpcs-git-pre-commit"
Or alternatively, include a dependency for damien-list/phpcs-git-pre-commit
in your composer.json file manually:
{
"require-dev": {
"damien-list/phpcs-git-pre-commit": "dev-master"
}
}
To enable code sniff, аdd to post-install-cmd
and post-update-cmd
in composer.json
installation script:
"post-install-cmd": [
"sh ./vendor/damien-list/phpcs-git-pre-commit/src/setup.sh"
],
"post-update-cmd": [
"sh ./vendor/damien-list/phpcs-git-pre-commit/src/setup.sh"
]
Then run composer install
or composer update
. pre-commit
hook will be installed or updated if it already exists.
Usage
Run git commit
and pre-commit hook will check your committed files like if you run
php-cs-fixer fix /path/to/file.php --dry-run
Contributing
Feel free to make pull requests!