Commit 35d71e94 authored by Emanuele Aina's avatar Emanuele Aina

check-commit-message: Don't complain about long words

Do not enforce line length checks on lines that contain a single
overly-long word such as an URL, as it will violate the constrain
regardless of the formatting.
Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
Reviewed-by: Martyn Welch's avatarMartyn Welch <martyn.welch@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D7473
parent d81a3ece
......@@ -106,9 +106,17 @@ if len(header['Subject']) > 75:
# Line in body too long
for line in body:
if len(line) > 75 and not line.startswith(SOB_PREFIX):
add_issue("Body line too long ({} chars, <= 72 recommended): {}".format(
len(line), line))
if len(line) <= 75:
continue
if line.startswith(SOB_PREFIX):
continue
if len(line.split()) == 1:
# bail out if the line contains a single long word (for instance an URL)
continue
add_issue("Body line too long ({} chars, <= 72 recommended): {}".format(
len(line), line))
if issuefile is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment