comparison contrib/check-commit @ 27692:e0465035def9

check-commit: try to curb bad commit summary keywords The goal of commit summary keywords is to help us sort, categorize, and filter our voluminous commits for our release notes in a way that's helpful and meaningful to end users. Lately, there have been a huge number of "keywords" that are neither words nor particularly key. This patch tries to discourage that by narrowing the allowed characters to alphanumeric. In particular, it doesn't allow "." (method, function names, and file extensions) and "/" (filenames). It also gives a short reminder of what a keyword ought to be.
author Matt Mackall <mpm@selenic.com>
date Thu, 10 Dec 2015 12:56:23 -0600
parents 8f5735b4aca5
children b2479d305c10
comparison
equal deleted inserted replaced
27691:b0d23a55f91e 27692:e0465035def9
24 (r"^# User [^@\n]+$", "username is not an email address"), 24 (r"^# User [^@\n]+$", "username is not an email address"),
25 (r"^# .*\n(?!merge with )[^#]\S+[^:] ", 25 (r"^# .*\n(?!merge with )[^#]\S+[^:] ",
26 "summary line doesn't start with 'topic: '"), 26 "summary line doesn't start with 'topic: '"),
27 (r"^# .*\n[A-Z][a-z]\S+", "don't capitalize summary lines"), 27 (r"^# .*\n[A-Z][a-z]\S+", "don't capitalize summary lines"),
28 (r"^# .*\n[^\n]*: *[A-Z][a-z]\S+", "don't capitalize summary lines"), 28 (r"^# .*\n[^\n]*: *[A-Z][a-z]\S+", "don't capitalize summary lines"),
29 (r"^# [^\n]*\n\S*[^A-Za-z0-9-]\S*: ",
30 "summary keyword should be most user-relevant one-word command or topic"),
29 (r"^# .*\n.*\.\s+$", "don't add trailing period on summary line"), 31 (r"^# .*\n.*\.\s+$", "don't add trailing period on summary line"),
30 (r"^# .*\n[^#].{77,}", "summary line too long (limit is 78)"), 32 (r"^# .*\n[^#].{77,}", "summary line too long (limit is 78)"),
31 (r"^\+\n \n", "adds double empty line"), 33 (r"^\+\n \n", "adds double empty line"),
32 (r"^ \n\+\n", "adds double empty line"), 34 (r"^ \n\+\n", "adds double empty line"),
33 (r"^\+[ \t]+def [a-z]+_[a-z]", "adds a function with foo_bar naming"), 35 (r"^\+[ \t]+def [a-z]+_[a-z]", "adds a function with foo_bar naming"),