Download the PHP package mironov-pik/pik-pre-commit-hook without Composer
On this page you can find all versions of the php package mironov-pik/pik-pre-commit-hook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mironov-pik/pik-pre-commit-hook
More information about mironov-pik/pik-pre-commit-hook
Files in mironov-pik/pik-pre-commit-hook
Package pik-pre-commit-hook
Short Description PHPCS check before commit
License GPL-3.0
Informations about the package pik-pre-commit-hook
Universal 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 and https://github.com/smgladkovskiy/phpcs-git-pre-commit and https://gist.github.com/BrizzleRocker/62ed61b37acf05344d4bce894e719251 . Installer checks OS on hosting machine and installs needed hooks for platform.
Installation
Install mironov-pik/phpcs-pre-commit-hook
with composer require command:
composer require "mironov-pik/phpcs-pre-commit-hook"
Or alternatively, include a dependency for mironov-pik/phpcs-pre-commit-hook
in your composer.json file manually:
{
"require-dev": {
"mironov-pik/phpcs-pre-commit-hook": "*"
}
}
To enable code sniff, аdd to post-install-cmd
and post-update-cmd
in composer.json
installation script:
"scripts": {
"post-install-cmd": [
"PHPLinter\\Installer::install"
],
"post-update-cmd": [
"PHPLinter\\Installer::install"
]
}
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 phpcs.phar --standard=PSR2 --colors --encoding=utf-8 -n -p /path/to/file.php