2017 © Pedro Peláez
 

library captainhook

PHP git hook manager

image

sebastianfeldmann/captainhook

PHP git hook manager

  • Thursday, May 3, 2018
  • by sebastianfeldmann
  • Repository
  • 2 Watchers
  • 37 Stars
  • 8,187 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 10 Forks
  • 0 Open issues
  • 19 Versions
  • 42 % Grown

The README.md

NOTE: This repository is abandoned, please use the official captaionhook repository instead.

CaptainHook

Latest Stable Version Downloads Build Status Twitter, (*1)

CaptainHook is an easy to use and very flexible git hook library for php developers. It enables you to configure your git hook actions in a simple json file., (*2)

You can use CaptainHook to validate or prepare your commit messages, ensure code quality or run unit tests before you commit or push changes to git. You can automatically clear local caches or install the latest composer dependencies after pulling the latest changes., (*3)

CaptainHook makes it easy to share hooks within your team and even can make sure that everybody in your team activates the hooks locally., (*4)

You can run cli commands, use some built in validators, or write your own PHP classes that get executed by CaptainHook. For more information have a look at the documentation., (*5)

Install official version

Install the CaptainHook PHAR using Phive or download the PHAR from the github release page., (*6)

    $ phive install captainhook

Or use Composer to install CaptainHook., (*7)

    $ composer require --dev captainhook/captainhook

Setup

After installing CaptainHook you can use the captainhook executable to create a configuration., (*8)

    $ vendor/bin/captainhook configure

Now there should be a captainhook.json configuration file., (*9)

If you are not using the composer-plugin yet you have to activate the hooks manually by installing them to your local .git repository. To do so just run the following captainhook command., (*10)

    $ vendor/bin/captainhook install

Have a look at this short installation video., (*11)

Install demo, (*12)

If you want to make sure your whole team uses the same hooks and you want to make sure everybody has the hooks installed you can use the CaptainHook composer-plugin as an addition., (*13)

    $ composer require --dev captainhook/plugin-composer

The plugin will make sure that the hooks get activated after every composer install or update. If you don't like the extra dependency just add the following scripts command to your composer.json file instead., (*14)

{
  "scripts": {
    "post-autoload-dump": "vendor/bin/captainhook install -f -s"
  }
}

Configuration

Here's an example captainhook.json configuration file., (*15)

{
  "commit-msg": {
    "enabled": true,
    "actions": [
      {
        "action": "\\CaptainHook\\App\\Hook\\Message\\Action\\Beams",
        "options": []
      }
    ]
  },
  "pre-commit": {
    "enabled": true,
    "actions": [
      {
        "action": "phpunit"
      },
      {
        "action": "phpcs --standard=psr2 src"
      }
    ]
  },
  "pre-push": {
    "enabled": false,
    "actions": []
  }
}

Contributing

So you'd like to contribute to the CaptainHook library? Excellent! Thank you very much. I can absolutely use your help., (*16)

Have a look at the contribution guidelines., (*17)

The Versions

03/05 2018

dev-master

9999999-dev https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

03/05 2018

2.1.1

2.1.1.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

18/01 2018

2.1.0

2.1.0.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

14/01 2018

2.0.5

2.0.5.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

04/10 2017

2.0.4

2.0.4.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

25/04 2017

2.0.3

2.0.3.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

21/04 2017

2.0.2

2.0.2.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

21/04 2017

2.0.1

2.0.1.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

01/02 2017

2.0.0

2.0.0.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

23/01 2017

2.0.0-beta1

2.0.0.0-beta1 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

14/01 2017

1.2.1

1.2.1.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

20/09 2016

1.2.0

1.2.0.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

14/09 2016

1.1.1

1.1.1.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

13/09 2016

1.1.0

1.1.0.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

12/09 2016

1.0.4

1.0.4.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

08/09 2016

1.0.3

1.0.3.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

08/09 2016

1.0.2

1.0.2.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

07/09 2016

1.0.1

1.0.1.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg

07/09 2016

1.0.0

1.0.0.0 https://github.com/sebastianfeldmann/captainhook

PHP git hook manager

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Feldmann

git pre-commit hooks pre-push commit-msg