summaryrefslogtreecommitdiff
path: root/git-hooks
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-01-31 14:42:53 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-02-01 14:12:49 +0000
commit7f2dc562e3e13640f615c86d700da3b501091f59 (patch)
tree72097861b34bde24068545e07124773face68657 /git-hooks
parentd4c099ddd7a6709e89508049485157380ab2dc1c (diff)
downloadqtrepotools-7f2dc562e3e13640f615c86d700da3b501091f59.tar.gz
Teach sanity bot to warn about mood in commit subject
Commit subjects should be written in the imperative, present tense. Change-Id: I99f1864af18c546704011d24aeeae05d8f2b7631 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/sanitize-commit4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit
index 9a11fb1..75beac5 100755
--- a/git-hooks/sanitize-commit
+++ b/git-hooks/sanitize-commit
@@ -332,6 +332,10 @@ while (<MSG>) {
if (/\.$/) {
complain_cln("Summary ends with period", "log");
}
+ # Detect wrong tense, but exclude cases like 'Speed up ...'
+ if (/^\w+(ing|[^e](ed)|es)\s/) {
+ complain_cln("Summary does not use imperative mood", "log");
+ }
if (!$badlog && length($_) < 7) {
complain_cln("Summary is too short", "log");
} elsif (!$badlog && !$revert1 && length($_) > 120) {