Integrate pre-commit into Magit. Press @ from any magit buffer to open the pre-commit menu.
In packages.el:
(package! magit-pre-commit
:recipe (:host github :repo "DamianB-BitFlipper/magit-pre-commit.el"))In config.el:
(use-package! magit-pre-commit
:after magit)(use-package magit-pre-commit
:straight (:host github :repo "DamianB-BitFlipper/magit-pre-commit.el")
:after magit)| Key | Action |
|---|---|
@ |
Open pre-commit menu (from magit) |
@ r |
Run on staged files |
@ a |
Run on all files |
@ h |
Run specific hook (with completion) |
@ i |
Install hooks |
@ u |
Update hooks |
@ k |
Kill running process |
- Auto-activates when
pre-commitexecutable is available and.pre-commit-config.yamlexists - Tab-completion for hook names parsed from your
.pre-commit-config.yaml - Status section in magit-status shows running/failed hooks with ANSI color support
magit-pre-commit- Open the pre-commit transient menumagit-pre-commit-run- Run on staged filesmagit-pre-commit-run-all- Run on all filesmagit-pre-commit-run-hook- Run a specific hook (with completion)magit-pre-commit-install- Install pre-commit git hooksmagit-pre-commit-autoupdate- Update hooks to latest versionsmagit-pre-commit-kill- Kill running pre-commit process