Add check_phase to pre-commit settings#415
Conversation
@joedevivo, if I understand correctly, the issue you were having was that, after setting As far as the feature itself goes, the |
|
Added the mentioned test cases to the new test suite https://github.com/cachix/git-hooks.nix/pull/423/files#diff-6c8d597050bd88f356507ec90b216be2fcd69fce6e488c62060f12bae96deddeR37-R51 Indeed my PR appears to fix the mentioned issue already. Let me know if I misunderstood anything. |
|
|
||
| check_stage = | ||
| mkOption { | ||
| type = types.str; |
There was a problem hiding this comment.
This could be the enum part of supportedHooksLib.supportedHooksType
| '' | ||
| This is pre-commit stage to be used in a nix `checkPhase`. `commit` maps to `pre-commit`, which is `pre-commit`'s default. | ||
| ''; | ||
| default = "commit"; |
There was a problem hiding this comment.
We could set this to the first of default_stages and fallback to pre-commit
|
Superseded by #689. |
The existing behavior of
pre-commit-hooks.nixis to use thepre-commitphase of pre-commit hooks, unless yourdefault_phases = [ "manual" ]. On further inspection I found that it has to be onlymanual. Ifdefault_phases = [ "manual" "push" ], it will usecommit. In my particular case, I wanteddefault_phases = [ "push" ], which then rancommithooks when I rannix flake check.This PR adds
check_phaseto the configuration. Settingcheck_phase = "push"runs thepre-pushphase checks when I runnix flake checkno matter what mydefault_phasesare.