A Composer plugin that registers git hooks and runs configured quality tasks on each commit, blocking commits when checks fail.
Overview
GrumPHP is a PHP code-quality tool delivered as a Composer plugin. After installation it attaches to your project’s git hooks so that when someone commits, GrumPHP runs selected validation tasks on the changed code. Failed tasks prevent the commit from completing.
The tool ships with common tasks and works with minimal configuration through a grumphp.yml-style config file in the project root. You choose which tasks to enable or disable. It requires php, composer, and git on the command line and supports PHP 5.6 and above.
Reported git client compatibility includes command-line git on Unix, Mac, and Windows, plus PhpStorm Git, SourceTree, and SmartGit. CLI commands cover configuration, hook init and deinit, pre-commit and commit-msg hooks, and a run command.
Installation can use Composer with dependencies, as a phar, or via phive. Unless you install with flags that skip plugins or scripts, GrumPHP replaces existing hooks but creates a backup of prior hooks.
Key features
- Git hook integration
- Blocks failing commits
- Built-in common tasks
- YAML project configuration
- Selectable task set
- CLI run and configure
- Multiple install options
- IDE git client support
Use cases
- PHP commit-time linting
- Team code style enforcement
- Local pre-commit gates
- Composer project hygiene
- Git workflow automation