captainhook/grumphp

GrumPHP-Integration for CaptainHook

Installs: 3 945

Dependents: 0

Suggesters: 0

Security: 0

Stars: 11

Watchers: 3

Forks: 1

Open Issues: 0

Type:composer-plugin

0.2.0 2020-05-19 11:07 UTC

This package is auto-updated.

Last update: 2024-10-19 20:31:45 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" : []
        }]
    }
}