Download the PHP package unh3ck3d/php-cs-fixer-git-hook without Composer
On this page you can find all versions of the php package unh3ck3d/php-cs-fixer-git-hook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download unh3ck3d/php-cs-fixer-git-hook
More information about unh3ck3d/php-cs-fixer-git-hook
Files in unh3ck3d/php-cs-fixer-git-hook
Package php-cs-fixer-git-hook
Short Description Git hook running PHP CS Fixer on staged files using CaptainHook
License MIT
Homepage https://github.com/Unh3ck3d/php-cs-fixer-git-hook
Informations about the package php-cs-fixer-git-hook
php-cs-fixer-git-hook
Git hook running PHP CS Fixer on staged files using CaptainHook
Report Bug
·
Request Feature
About The Project
Git hook that with each git commit
command runs Php Cs Fixer
on staged files to automatically fix them and re-stage before committing.
(back to top)
Requirements
- PHP >= 8.0
- CaptainHook >= 5.0
- PHP CS Fixer
(back to top)
Installation
-
Install package as a dev dependency using composer
-
Add the following code to your
captainhook.json
configuration file - Install newly added hook by following CaptainHook docs
That's it. From now on after running git commit
files that were staged will be
automatically fixed by Php Cs Fixer.
(back to top)
Configuration
You can customize the behaviour how git hook is run by changing following options
Option | Description |
---|---|
phpCsFixerPath | Path to Php Cs Fixer executable. Defaults to ./vendor/bin/php-cs-fixer . |
pathMode | path-mode cli option of Php Cs Fixer. Defaults to intersection . |
config | config cli option of Php Cs Fixer. Defaults to .php-cs-fixer.dist.php . |
additionalArgs | String of additional arguments that will be passed to Php Cs Fixer process. |
e.g.
(back to top)
License
Distributed under the MIT License. See LICENSE
for more information.
(back to top)