项目作者: dadolun95

项目描述 :
CaptainHook extension adding customized hooks
高级语言: PHP
项目地址: git://github.com/dadolun95/dadolunhook.git
创建时间: 2019-07-11T14:24:53Z
项目社区:https://github.com/dadolun95/dadolunhook

开源协议:

下载


dadolunhook

CaptainHook extension adding customized hooks
Thanks for the amazing work made by CaptainHook ( https://github.com/CaptainHookPhp/captainhook ) by sebastianfeldmann!

How it works

This repo must be forked letting you specify your new amazing hooks into DadolunHook\App\Runner\Configurator\Setup\Dadolun class. This is only an example to how captainhook original extension can be extented and customized with new hooks without touching the original repo.

Installation

Add the dependency to your composer.json:

  1. {
  2. ...
  3. "require-dev": {
  4. ...
  5. "dadolun95/dadolunhook": "dev-master",
  6. ...
  7. },
  8. "repositories": [
  9. ...
  10. "dadolun95-public":{
  11. "type": "vcs",
  12. "url": "git@github.com:dadolun95/dadolunhook.git"
  13. },
  14. ...
  15. ],
  16. ...
  17. }

Use Composer to install DadolunHook.

  1. $ composer require --dev dadolun95/dadolunhook

Setup

After installing DadolunHook you can use the dadolunhook executable to create a configuration.

  1. $ vendor/bin/dadolunhook dadolunconfigure

Now there should be a captainhook.json configuration file.

Now you can run the following captainhook command.

  1. $ vendor/bin/captainhook install

Here’s an example captainhook.json configuration file.

  1. {
  2. "commit-msg": {
  3. "enabled": true,
  4. "actions": [
  5. {
  6. "action": "\\CaptainHook\\App\\Hook\\Message\\Action\\Beams",
  7. "options": []
  8. }
  9. ]
  10. },
  11. "pre-commit": {
  12. "enabled": true,
  13. "actions": [
  14. {
  15. "action": "phpunit"
  16. },
  17. {
  18. "action": "phpcs --standard=psr2 src"
  19. }
  20. ]
  21. },
  22. "pre-push": {
  23. "enabled": false,
  24. "actions": []
  25. }
  26. }