joaorobertopb/php-githook-sniffer

Php-GitHook-Sniffer is a simple collection of automated and customizable tasks that you can perform with your git repository through the hooks.

0.0.5 2018-02-23 14:22 UTC

This package is auto-updated.

Last update: 2024-12-06 01:09:47 UTC


README

README em Português.

Build Status Latest Stable Version Total Downloads Latest Unstable Version Code Coverage Quality Score Software License

Php-GitHook-Sniffer is a simple collection of automated tasks that you can perform with your git repository through the hooks.

Available hooks

  • pre-commit

pre-commit

Check the commited files:

  • Check PHP Syntax (with PHPLint)
  • Fix code style according to PSR2 standard

Examples

verifying syntax:

php-lint

Applying PSR2 rules:

php-cs-fix

Other Hooks

Coming Soon.

Install

Add joaorobertopb/php-githook-sniffer as a development dependency in composer.json

"require-dev": {
    "joaorobertopb/php-githook-sniffer": "~0.0.5"
}

Or via Composer

$ composer require joaorobertopb/php-githook-sniffer --dev

Copy src/Hooks/pre-commit for .git/hooks. ( Execution Permission Required )

$ php -r "if(file_exists('./.git')&&file_exists('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit')){copy('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0777);}"

or

"scripts": {
    "post-install-cmd": [
      "php -r \"if(file_exists('./.git')&&file_exists('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit')){copy('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0777);}\""
    ],
    "post-update-cmd": [
      "php -r \"if(file_exists('./.git')&&file_exists('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit')){copy('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0777);}\""
    ]
}

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Coming Soon.

Credits

License

The MIT License (MIT). Please see License File for more information.