phpro/grumphp
GrumPHP is a Composer plugin that installs Git hooks to run quality checks on every commit. It executes configured tasks like tests and linters, blocks failing commits, and helps teams enforce coding standards and best practices automatically.
Full Changelog: https://github.com/phpro/grumphp/compare/v2.22.0...v2.23.0
GrumPHP just made a new friend. Starting this release, you can run Mago straight from your hooks.
Mago is a PHP toolchain written in Rust. The name means "wizard," which fits: it does the work of four tools at once. A formatter, a linter, a static analyzer, and an architectural guard, all in a single fast binary. It's already showing up in places like Drupal.
We didn't bolt it on as one big task. Each part gets its own, so you turn on only what you want and configure them separately:
mago_format keeps your code style consistentmago_lint catches style slips, smells, and likely bugsmago_analyze does the deeper work: types, control flow, logic errorsmago_guard enforces your architecture and layer rulesFormat, lint, and analyze run read-only by default. When one fails, GrumPHP offers to re-run it with fixes applied, so you stay in control. Guard only reports, because you can't auto-fix an architecture problem (Mago won't pretend otherwise).
Add it to your project like any other tool:
composer require --dev carthage-software/mago
vendor/bin/mago init
Then point your grumphp.yml at whichever tasks you want. Full setup and options live in the Mago task docs.
The grump approves. Welcome to the family, Mago. 🧙🦊
amend! prefix in commit message task by @reynkonig in https://github.com/phpro/grumphp/pull/1224Full Changelog: https://github.com/phpro/grumphp/compare/v2.21.0...v2.22.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.20.0...v2.21.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.19.0...v2.20.0
❗ Requires re-initialization from git hooks
In the new version of our dependency gitlib, you need to pass the --raw option to the git diff that is being parsed by the pre-commit hooks. This means you'll need to change your git hook after upgrading:
./vendor/bin/grumphp git:init
If you are using a custom hook, make sure to add the --raw parameter to git diff first:
DIFF=$(git -c diff.mnemonicprefix=false -c diff.noprefix=false --no-pager diff --raw -r -p -m -M --full-index --no-color --staged | cat)
Full Changelog: https://github.com/phpro/grumphp/compare/v2.18.0...v2.19.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.17.0...v2.18.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.16.0...2.17.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.16.0...v2.17.0
composer_validate_autoload task by @TravisCarden in https://github.com/phpro/grumphp/pull/1186Full Changelog: https://github.com/phpro/grumphp/compare/v2.15.0...v2.16.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.14.0...v2.15.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.13.0...v2.14.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.12.0...v2.13.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.11.0...v2.12.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.10.0...v2.11.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.9.0...v2.10.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.8.0...v2.9.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.7.0...v2.8.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.6.0...v2.7.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.5.0...v2.6.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.4.0...v2.5.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.3.0...v2.4.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.2.0...v2.3.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.1.0...v2.2.0
Full Changelog: https://github.com/phpro/grumphp/compare/v2.0.0...v2.1.0
Full Changelog: https://github.com/phpro/grumphp/compare/v1.16.0...v2.0.0-beta1
❗ Change in dependencies - we now require:
If your project is still using AMP v2 - you might consider using our dependencyless shim package instead : https://github.com/phpro/grumphp-shim
❗ This version contains some BC breaks for GrumPHP extension or task developers.
Find out how to upgrade your tasks and extensions here : https://github.com/phpro/grumphp/blob/v2.0.0-beta1/UPGRADE-v2.md
Full Changelog: https://github.com/phpro/grumphp/compare/v1.16.0...v2.0.0
Full Changelog: https://github.com/phpro/grumphp/compare/v1.16.0...v2.0.0-beta1
composer require 'phpro/grumphp:^2.0.0-beta1@beta' --update-with-dependencies
❗ Change in dependencies - we now require:
❗ This version contains some BC breaks for GrumPHP extension or task developers.
Find out how to upgrade your tasks and extensions here : https://github.com/phpro/grumphp/blob/v2.0.0-beta1/UPGRADE-v2.md
Full Changelog: https://github.com/phpro/grumphp/compare/v1.15.0...v1.16.0
Full Changelog: https://github.com/phpro/grumphp/compare/v1.14.0...v1.15.0
Full Changelog: https://github.com/phpro/grumphp/compare/v1.13.0...v1.14.0
Full Changelog: https://github.com/phpro/grumphp/compare/v1.12.0...v1.13.0
Full Changelog: https://github.com/phpro/grumphp/compare/v1.11.0...v1.12.0
show_mutations (incl. verbose mode) by @jerowork in https://github.com/phpro/grumphp/pull/998Full Changelog: https://github.com/phpro/grumphp/compare/v1.10.0...v1.11.0
Full Changelog: https://github.com/phpro/grumphp/compare/v1.9.0...v1.10.0
no-dev option for local-php-security-checker by @a-menshchikov in https://github.com/phpro/grumphp/pull/984Full Changelog: https://github.com/phpro/grumphp/compare/v1.8.1...v1.9.0
This release fixes grumphp-shim issues.
Full Changelog: https://github.com/phpro/grumphp/compare/v1.8.0...v1.8.1
How can I help you explore Laravel packages today?