captainhook / grumphp
GrumPHP-Integration for CaptainHook
Installs: 3 945
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 2
Forks: 1
Type:composer-plugin
pkg:composer/captainhook/grumphp
Requires
- php: ^7.2|^8.0
- composer-plugin-api: ~1.0
- ext-json: *
- captainhook/captainhook: ^5.0
- phpro/grumphp: ^0.18
Requires (Dev)
- composer/composer: ^1.8
- mockery/mockery: ^1.2
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2025-10-19 22:52:25 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" : []
        }]
    }
}