[PATCH OLK-5.10 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 9a1c5ac4ba07..e55bdcc938be 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2868,7 +2868,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> 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 e55bdcc938be..61382510d497 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -502,6 +502,7 @@ our $signature_tags = qr{(?xi: Reviewed-by:| Reported-by:| Suggested-by:| + Assisted-by:| To:| Cc: )}; @@ -2789,6 +2790,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, $name_comment, $email_address, $comment) = parse_email($email); my $suggested_email = format_email(($email_name, $name_comment, $email_address, $comment)); if ($suggested_email eq "") { -- 2.34.1
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitcode.com/openeuler/kernel/merge_requests/29155 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/UAU... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitcode.com/openeuler/kernel/merge_requests/29155 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/UAU...
participants (2)
-
patchwork bot -
Tengda Wu