mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] checkpatch: improve signature check on empty description
@ 2023-04-03 23:18 Scott Branden
  0 siblings, 0 replies; only message in thread
From: Scott Branden @ 2023-04-03 23:18 UTC (permalink / raw)
  To: BCM Kernel Feedback, Andy Whitcroft, Joe Perches
  Cc: Dwaipayan Ray, Lukas Bulwahn, linux-kernel, Scott Branden

Existing check assumed there could be a single Signed-off-by line which
should be ignored when checking for an empty commit message.
Other lines with identifiers "Reported-by:", "Acked-by:", or anything
invented by the person who constructed the commit were counted as a
body of the commit message.

Improve the check for an empty body of the commit message by not counting
any lines that begin with a $signature or similar formatted line of a
keyword followed by a colon.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
---
 scripts/checkpatch.pl | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bd44d12965c9..5922a6df7f5d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2901,15 +2901,14 @@ sub process {
 		$cnt_lines++ if ($realcnt != 0);
 
 # Verify the existence of a commit log if appropriate
-# 2 is used because a $signature is counted in $commit_log_lines
 		if ($in_commit_log) {
-			if ($line !~ /^\s*$/) {
-				$commit_log_lines++;	#could be a $signature
+			if ($line !~ /^\s*($|[a-zA-Z0-9_-]+:)/) {
+				$commit_log_lines++;
 			}
-		} elsif ($has_commit_log && $commit_log_lines < 2) {
+		} elsif ($has_commit_log && $commit_log_lines < 1) {
 			WARN("COMMIT_MESSAGE",
 			     "Missing commit description - Add an appropriate one\n");
-			$commit_log_lines = 2;	#warn only once
+			$commit_log_lines = 1;	#warn only once
 		}
 
 # Check if the commit log has what seems like a diff which can confuse patch
-- 
2.40.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-03 23:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 23:18 [PATCH] checkpatch: improve signature check on empty description Scott Branden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®