History

scripts/checkpatch: add Assisted-by: tag validation

The coding-assistants.rst documentation defines the Assisted-by: tag format for AI-assisted contributions as: Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2] This format does not use an email address, so checkpatch currently reports a false positive about an invalid email when encountering this tag. Add Assisted-by: to the recognized signature tags and standard signature list. When an Assisted-by: tag is found, validate it instead of checking for an email address. Examples of passing tags: - Claude:claude-3-opus coccinelle sparse - FOO:BAR.baz - Copilot Github:claude-3-opus - GitHub Copilot:Claude Opus 4.6 - My Cool Agent:v1.2.3 coccinelle sparse Examples of tags triggering the new warning: - Claude coccinelle sparse - JustAName - :missing-agent

Harry Wentland committed 7 months ago

Commit 8545d9b1 parent 6de23f81 file · +11 −1Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+11−1
@@ -641,6 +641,7 @@ our $signature_tags = qr{(?xi: · 640 unmodified lines
641641 Reviewed-by:|
642642 Reported-by:|
643643 Suggested-by:|
644+ Assisted-by:|
644645 To:|
645646 Cc:
646647 )};
@@ -737,7 +738,7 @@ sub find_standard_signature { · 90 unmodified lines
737738 my ($sign_off) = @_;
738739 my @standard_signature_tags = (
739740 'Signed-off-by:', 'Co-developed-by:', 'Acked-by:', 'Tested-by:',
740− 'Reviewed-by:', 'Reported-by:', 'Suggested-by:'
741+ 'Reviewed-by:', 'Reported-by:', 'Suggested-by:', 'Assisted-by:'
741742 );
742743 foreach my $signature (@standard_signature_tags) {
743744 return $signature if (get_edit_distance($sign_off, $signature) <= 2);
@@ -3105,6 +3106,15 @@ sub process { · 2361 unmodified lines
31053106 }
31063107 }
31073108
3109+# Assisted-by: uses format AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2] instead of email
3110+ if ($sign_off =~ /^assisted-by:$/i) {
3111+ if ($email !~ /^[^:]+:\S+(\s+\S+)*$/) {
3112+ WARN("BAD_ASSISTED_BY",
3113+ "Assisted-by: should use format: 'Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]'\n" . $herecurr);
3114+ }
3115+ next;
3116+ }
3117+
31083118 my ($email_name, $name_comment, $email_address, $comment) = parse_email($email);
31093119 my $suggested_email = format_email(($email_name, $name_comment, $email_address, $comment));
31103120 if ($suggested_email eq "") {