checkpatch: only check signature styles in the commit message
PATCH 1/1 checkpatch: only check signature styles in the commit message
Patches removing lines ending in "by:" will cause false-positive warnings about non-standard / malformed signatures. Only looking for malformed signatures in the commit message avoids this.
Given this patch:
Quoted 16 lines
From: Aren Moynihan <[email protected]>
Date: Wed, 2 Apr 2025 16:34:53 -0400
Subject: [PATCH] Test commitThis is a test commit
Signed-off-by Aren Moynihan <[email protected]>--- test-file.c | 1 - 1 file changed, 1 deletion(-)test-file.c +0
-0
test-file.c line 2
Quoted 3 lines
test-file.c +0
-1@@ -1,3 +1,2 @@int foo () { -err_standby: }
Before:
Quoted 8 lines
WARNING: Non-standard signature: -err_standby:
#19: FILE: test-file.c:1:
-err_standby:WARNING: Use a single space after -err_standby:
#19: FILE: test-file.c:1:
-err_standby:
Quoted 5 lines
ERROR: Unrecognized email address: ''
#19: FILE: test-file.c:1:
-err_standby:total: 1 errors, 2 warnings, 3 lines checked
After:
Quoted 1 line
total: 0 errors, 0 warnings, 3 lines checked
A real world example of this can be found here:
https://lore.kernel.org/lkml/[email protected]/
--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
@@ -3014,7 +3014,7 @@ sub process { } # Check signature styles - if (!$in_header_lines && + if ($in_commit_log && $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) { my $space_before = $1; my $sign_off = $2;
Signature · 1 line
2.49.0