Skip to content

Simple collection of automated tasks that you can perform with your git repository through the hooks.

License

Notifications You must be signed in to change notification settings

joaorobertopb/php-githook-sniffer

Repository files navigation

Php GitHook Sniffer

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.

About

Simple collection of automated tasks that you can perform with your git repository through the hooks.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages