From 7c1057e9bcba7ed5090fd62b9fef0570fadb06e6 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Fri, 7 Jul 2023 07:09:35 +0200 Subject: [PATCH] test_commit_format: no longer check body length 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 --- integration_tests/test_commit_format.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/integration_tests/test_commit_format.py b/integration_tests/test_commit_format.py index f815231..6b88a3c 100644 --- a/integration_tests/test_commit_format.py +++ b/integration_tests/test_commit_format.py @@ -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 @@ -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' "