2017 © Pedro Peláez
 

library hooker

An extendable PHP commit hook

image

bigtallbill/hooker

An extendable PHP commit hook

  • Wednesday, May 25, 2016
  • by bigtallbill
  • Repository
  • 2 Watchers
  • 3 Stars
  • 948 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Build Status, (*1)

Coverage Status, (*2)

codeship, (*3)

hooker

An extendable php commit hook, (*4)

Installation

  1. Download binary https://github.com/bigtallbill/hooker/releases/tag/0.1.0
  2. Copy the binary release to a directory that is loaded by your PATH
  3. Make the file executable chmod a+x hooker
  4. Check installation which hooker

Usage

  1. open a terminal and cd to the target repository
  2. run hooker install

This will install a hooker.json config file and also update the commit hook files for this repo to execute hooker, (*5)

Now when you try to commit something for example. hooker will execute., (*6)

hooker.json Config

The hooker.json config file contains settings for each type of hook., (*7)

{
    "preCommit": {},
    "commitMsg": {
        "firstWordImperative": true,
        "maxSummaryLength": 50,
        "maxContentLength": 72,
        "summaryIgnoreUrls": true,
        "contentIgnoreUrls": true,
        "lineAfterSummaryMustBeBlank": true,
        "scripts": {
            "after": [
                {
                    "cmd": "runtests.sh",
                    "passGitArgs": false,
                    ""
                }
            ]
        }
    }
}

"scripts"

Every hook type can have the element scripts. This allows you to execute arbitrary code that is not a native hooker check., (*8)

"scripts": {
    "after": [
        {
            "cmd": "runtests.sh"
        }
    ]
}

The "after" key defines when to run the script (currently after is the only one). After means run after hooker's own internal code for that hook., (*9)

Then we have an array of scripts to run., (*10)

Here is a sample script object:, (*11)

{
    "cmd": "runtests.sh",
    "passGitArgs": false,
    "relativeToRepo": false
}

"cmd" is the command to execute, (*12)

"passGitArgs" When set to true will append the git arguments onto the scripts existing arguments, (*13)

"relativeToRepo" Execute this script relative to the repo. Currently this is pretty dumb, it will just prepend the repository path to the cmd., (*14)

"commitMsg"

  • firstWordImperative = Ensure that the first word in a commit message is imperative present-tense
  • maxSummaryLength = The maximum length of the summary line
  • maxContentLength = The maximum length of the message body
  • summaryIgnoreUrls = Ignore length of lines with urls in (useful if you cant help the length of urls)
  • contentIgnoreUrls = Ignore length of lines with urls in (useful if you cant help the length of urls)
  • lineAfterSummaryMustBeBlank = Ensure that the line after the summary is blank

The Versions

25/05 2016

dev-master

9999999-dev

An extendable PHP commit hook

  Sources   Download

proprietary

The Requires

 

The Development Requires

08/03 2015

0.1.3

0.1.3.0

An extendable PHP commit hook

  Sources   Download

proprietary

The Requires

 

The Development Requires

07/03 2015

0.1.2

0.1.2.0

An extendable PHP commit hook

  Sources   Download

proprietary

The Requires

 

The Development Requires

07/03 2015

0.1.1

0.1.1.0

An extendable PHP commit hook

  Sources   Download

proprietary

The Requires

 

The Development Requires

07/03 2015

0.1.0

0.1.0.0

An extendable PHP commit hook

  Sources   Download

proprietary

The Requires

 

The Development Requires

29/10 2014

0.0.3

0.0.3.0

An extendable PHP commit hook

  Sources   Download

proprietary

The Development Requires

25/10 2014

0.0.2

0.0.2.0

An extendable PHP commit hook

  Sources   Download

proprietary

The Development Requires

25/10 2014

0.0.1

0.0.1.0

An extendable PHP commit hook

  Sources   Download

proprietary

The Development Requires