git-hooks.nix icon indicating copy to clipboard operation
git-hooks.nix copied to clipboard

Add `check_phase` to pre-commit settings

Open joedevivo opened this issue 1 year ago • 2 comments

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.

joedevivo avatar Mar 25 '24 18:03 joedevivo