Skip to content

Commit

Permalink
feat(presets/lefthook): allow WIP and fixup! commit
Browse files Browse the repository at this point in the history
 workaround siderolabs/conform#225

 Also people very commonly use WIP commits before tidying up, so
 allowing them is probably necessary if we want people not disabling
 conform pre-commit hook.

 Note that this does not affect CI that should ideally still fail on
 WIP commits (TODO: run conform on CI).
  • Loading branch information
jbgi committed Oct 28, 2022
1 parent c8197a5 commit 2891735
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cells/presets/nixago/lefthook.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
commit-msg = {
commands = {
conform = {
run = "conform enforce --commit-msg-file {1}";
# allow WIP, fixup!/squash! commits locally
run = ''
[[ "$(head -n 1 {1})" =~ ^WIP$|^wip$|fixup\!.*|squash\!.* ]] ||
conform enforce --commit-msg-file {1}'';
skip = ["merge" "rebase"];
};
};
Expand Down

0 comments on commit 2891735

Please sign in to comment.