Skip to content

Commit

Permalink
test_commit_format: no longer check body length
Browse files Browse the repository at this point in the history
There are quite a few, genuine useful cases where one wants to overflow
the recommended 75 (some use 72) character rule.

Breaking long lines or manually breaking long compiler or other
tool-generated outputs is just confusing and error-prone.

This does not mean that we should stop wrapping manually written text
at a sane length, but enforcing the rule with a script seems to yield
questionable results while creating quite a bit of friction.

Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
  • Loading branch information
Ablu authored and JonathanWoollett-Light committed Jul 14, 2023
1 parent 9dfe5b2 commit 7c1057e
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions integration_tests/test_commit_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ def test_commit_format():
"""
Checks commit message format for the current PR's commits.
Checks if commit messages follow the 60/75 commit rule (a maximum
60 characters for the title and 75 characters for description
lines) and if commits are signed.
Checks if commit messages do not have exceedingly long titles (a maximum 60
characters for the title) and if commits are signed.
"""
# Newer versions of git check the ownership of directories.
# We need to add an exception for /workdir which is shared, so that
Expand Down Expand Up @@ -80,15 +79,8 @@ def test_commit_format():
for line in message_lines[2:]:
if line.startswith("Signed-off-by: "):
found_signed_off = True
# If we found `Signed-off-by` line, then it means
# the commit message ended and we don't want to check
# line lengths anymore for the current commit.
break
assert len(line) <= COMMIT_BODY_LINE_MAX_LEN, (
"For commit '{}', message line '{}' exceeds {} chars. "
"Please keep it shorter or split it in "
"multiple lines.".format(sha, line, COMMIT_BODY_LINE_MAX_LEN)
)

assert found_signed_off, (
"Commit '{}' is not signed. "
"Please run 'git commit -s --amend' "
Expand Down

0 comments on commit 7c1057e

Please sign in to comment.