From 11a0c0cbdb6a63e77fe477def998eac54c956153 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 1 Aug 2021 15:34:26 -0400 Subject: [PATCH] dev: add linter rule for commit capitalization Bad: 'fix(abc): Prevent freezes' Good: 'fix(abc): prevent freezes' --- core/cli/ci.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/cli/ci.el b/core/cli/ci.el index 66365c272..ad58e9966 100644 --- a/core/cli/ci.el +++ b/core/cli/ci.el @@ -46,6 +46,12 @@ "\\)!?[^ :]*: ") "Invalid type") + (cons (lambda () + (when (re-search-forward "^[^ :]+: " nil t) + (and (looking-at "[A-Z][^-]") + (not (looking-at "\\(SPC\\|TAB\\|ESC\\|LFD\\|DEL\\|RET\\)"))))) + "Do not capitalize the first word of the subject") + (cons (lambda () (looking-at "^\\(bump\\|revert\\|release\\|merge\\|module\\)!?([^)]+):")) "This commit type's scope goes after the colon, not before")