captainhook/grumphp

GrumPHP-Integration for CaptainHook

Installs: 385

Dependents: 0

Suggesters: 0

Stars: 6

Watchers: 2

Forks: 0

Open Issues: 0

Type:composer-plugin

0.1.0 2019-03-10 15:24 UTC

README

Integrate GrumPHP into CaptainHook.

This package allows you to use GrumPHP as one of the hooks for CaptainHook.

Installation:

composer require captainhook/grumphp

That should set up everything as you need it. You might want to tweak your grumphp.yml-File according to your needs. More details on that can be found in the GrumPHP-Documentation

Your captainhook.json should afterwards cnotain the following sections:

{
    "pre-commit": {
        "enabled": true,
        "actions": [{
            "action" : "DIFF=$(git -c diff.mnemonicprefix=false --no-pager diff -r -p -m -M --full-index --no-color --staged | cat); printf \"%s\n\" \"${DIFF}\" | exec ./vendor/bin/grumphp git:pre-commit --skip-success-output",
            "options" : []
        }]
    },
    "commit-msg" : {
        "enabled" : true,
        "actions" : [{
            "action" : "GIT_USER=$(git config user.name);GIT_EMAIL=$(git config user.email);COMMIT_MSG_FILE={FILE};DIFF=$(git -c diff.mnemonicprefix=false --no-pager diff -r -p -m -M --full-index --no-color --staged | cat);printf \"%s\n\" \"${DIFF}\" | exec ./vendor/bin/grumphp git:commit-msg \"--git-user=$GIT_USER\" \"--git-email=$GIT_EMAIL\" \"$COMMIT_MSG_FILE\"",
            "options" : []
        }]
    }
}