diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-01-31 14:42:53 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-02-01 14:12:49 +0000 |
commit | 7f2dc562e3e13640f615c86d700da3b501091f59 (patch) | |
tree | 72097861b34bde24068545e07124773face68657 /git-hooks | |
parent | d4c099ddd7a6709e89508049485157380ab2dc1c (diff) | |
download | qtrepotools-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-x | git-hooks/sanitize-commit | 4 |
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) { |