From dc3eb8a7cf9d5c9fcf70a4b4a18908e0644fbd30 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 26 Sep 2021 13:34:12 +0200 Subject: [PATCH] dev(ci): ignore fixup!/squash!/wip commits Otherwise the commit linter makes rebasing impossible without --no-verify, or in magit if the git hooks are installed. --- core/cli/ci.el | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/core/cli/ci.el b/core/cli/ci.el index 27e502b94..a90a28853 100644 --- a/core/cli/ci.el +++ b/core/cli/ci.el @@ -231,29 +231,30 @@ bang (equal (match-string 2) "!") scopes (ignore-errors (split-string (match-string 3) ",")) summary (match-string 4))))) - (dolist (fn doom-cli-commit-rules) - (pcase (funcall fn - :bang bang - :body body - :refs refs - :scopes scopes - :subject subject - :summary summary - :type type) - (`(,type . ,msg) - (push msg (if (eq type 'error) errors warnings))))) - (if (and (null errors) (null warnings)) - (print! (success "%s %s") (substring (car commit) 0 7) subject) - (print! (start "%s %s") (substring (car commit) 0 7) subject)) - (print-group! - (when errors - (cl-incf errors?) - (dolist (e (reverse errors)) - (print! (error "%s" e)))) - (when warnings - (cl-incf warnings?) - (dolist (e (reverse warnings)) - (print! (warn "%s" e)))))))) + (unless (string-match-p "^\\(?:\\(?:fixup\\|squash\\)!\\|FIXUP\\|WIP\\) " subject) + (dolist (fn doom-cli-commit-rules) + (pcase (funcall fn + :bang bang + :body body + :refs refs + :scopes scopes + :subject subject + :summary summary + :type type) + (`(,type . ,msg) + (push msg (if (eq type 'error) errors warnings))))) + (if (and (null errors) (null warnings)) + (print! (success "%s %s") (substring (car commit) 0 7) subject) + (print! (start "%s %s") (substring (car commit) 0 7) subject)) + (print-group! + (when errors + (cl-incf errors?) + (dolist (e (reverse errors)) + (print! (error "%s" e)))) + (when warnings + (cl-incf warnings?) + (dolist (e (reverse warnings)) + (print! (warn "%s" e))))))))) (when (> warnings? 0) (print! (warn "Warnings: %d") warnings?)) (when (> errors? 0)