From: Aren Moynihan <aren@peacevolution.org>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
linux-kernel@vger.kernel.org
Cc: Aren Moynihan <aren@peacevolution.org>
Subject: [PATCH] checkpatch: only check signature styles in the commit message
Date: Wed, 2 Apr 2025 19:22:52 -0400 [thread overview]
Message-ID: <20250402232251.734324-2-aren@peacevolution.org> (raw)
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:
> From: Aren Moynihan <aren@peacevolution.org>
> Date: Wed, 2 Apr 2025 16:34:53 -0400
> Subject: [PATCH] Test commit
>
> This is a test commit
>
> Signed-off-by: Aren Moynihan <aren@peacevolution.org>
> ---
> test-file.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/test-file.c b/test-file.c
> index 1527673..71c7e44 100644
> --- a/test-file.c
> +++ b/test-file.c
> @@ -1,3 +1,2 @@
> int foo() {
> -err_standby:
> }
Before:
> 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:
>
> ERROR: Unrecognized email address: ''
> #19: FILE: test-file.c:1:
> -err_standby:
>
> total: 1 errors, 2 warnings, 3 lines checked
After:
> total: 0 errors, 0 warnings, 3 lines checked
A real world example of this can be found here:
https://lore.kernel.org/lkml/20250208211325.992280-4-aren@peacevolution.org/
Signed-off-by: Aren Moynihan <aren@peacevolution.org>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 784912f570e9d..a7bb6df8510d1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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;
--
2.49.0
reply other threads:[~2025-04-02 23:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250402232251.734324-2-aren@peacevolution.org \
--to=aren@peacevolution.org \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®