[PATCH openEuler-1.0-LTS 0/2] Optimize checkpatch
Optimize checkpatch to support recognition of Reference and Assisted-by tags. Sasha Levin (1): checkpatch: add support for Assisted-by tag Tengda Wu (1): checkpatch: Add Reference tag to the COMMIT_LOG_LONG_LINE exemption list scripts/checkpatch.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.34.1
hulk inclusion category: bugfix bugzilla: https://atomgit.com/openeuler/kernel/issues/10069 -------------------------------- The Reference tag provides a link to the patch in the upstream community and is very likely to exceed 75 characters, which is expected. Add it to the exemption list to get rid of the COMMIT_LOG_LONG_LINE warning. Fixes: bf4daf12a9fb ("checkpatch: avoid some commit message long line warnings") Signed-off-by: Tengda Wu <wutengda2@huawei.com> --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 161b0224d6ae..6dddfa1da8a8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2686,7 +2686,7 @@ sub process { # file delta changes $line =~ /^\s*(?:[\w\.\-]+\/)++[\w\.\-]+:/ || # filename then : - $line =~ /^\s*(?:Fixes:|Link:)/i || + $line =~ /^\s*(?:Fixes:|Link:|Reference:)/i || # A Fixes: or Link: line $commit_log_possible_stack_dump)) { WARN("COMMIT_LOG_LONG_LINE", -- 2.34.1
From: Sasha Levin <sashal@kernel.org> mainline inclusion from mainline-v7.1-rc1 commit d1db4118489fffd2b2f612140b7acbb477880839 category: bugfix bugzilla: https://atomgit.com/openeuler/kernel/issues/10069 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- The Assisted-by tag was introduced in Documentation/process/coding-assistants.rst for attributing AI tool contributions to kernel patches. However, checkpatch.pl did not recognize this tag, causing two issues: WARNING: Non-standard signature: Assisted-by: ERROR: Unrecognized email address: 'AGENT_NAME:MODEL_VERSION' Fix this by: 1. Adding Assisted-by to the recognized $signature_tags list 2. Skipping email validation for Assisted-by lines since they use the AGENT_NAME:MODEL_VERSION format instead of an email address 3. Warning when the Assisted-by value doesn't match the expected format Link: https://lkml.kernel.org/r/20260311215818.518930-1-sashal@kernel.org Signed-off-by: Sasha Levin <sashal@kernel.org> Reported-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Cc: Dwaipayan Ray <dwaipayanray1@gmail.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Conflicts: scripts/checkpatch.pl [Context conflict.] Signed-off-by: Tengda Wu <wutengda2@huawei.com> --- scripts/checkpatch.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 6dddfa1da8a8..4027af71af72 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -473,6 +473,7 @@ our $signature_tags = qr{(?xi: Reviewed-by:| Reported-by:| Suggested-by:| + Assisted-by:| To:| Cc: )}; @@ -2625,6 +2626,15 @@ sub process { } } + # Assisted-by uses AGENT_NAME:MODEL_VERSION format, not email + if ($sign_off =~ /^Assisted-by:/i) { + if ($email !~ /^\S+:\S+/) { + WARN("BAD_SIGN_OFF", + "Assisted-by expects 'AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]' format\n" . $herecurr); + } + next; + } + my ($email_name, $email_address, $comment) = parse_email($email); my $suggested_email = format_email(($email_name, $email_address)); if ($suggested_email eq "") { -- 2.34.1
participants (1)
-
Tengda Wu