git-hooks.nix
git-hooks.nix copied to clipboard
Add `check_phase` to pre-commit settings
The existing behavior of pre-commit-hooks.nix is to use the pre-commit phase of pre-commit hooks, unless your default_phases = [ "manual" ]. On further inspection I found that it has to be only manual. If default_phases = [ "manual" "push" ], it will use commit. In my particular case, I wanted default_phases = [ "push" ], which then ran commit hooks when I ran nix flake check.
This PR adds check_phase to the configuration. Setting check_phase = "push" runs the pre-push phase checks when I run nix flake check no matter what my default_phases are.