scripts/checkpatch: add Assisted-by: tag validation
PATCH v2 1/1 scripts/checkpatch: add Assisted-by: tag validation
The coding-assistants.rst documentation defines the Assisted-by: tag format for AI-assisted contributions as:
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
--- scripts/checkpatch.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +11 -1
@@ -641,6 +641,7 @@ our $signature_tags = qr{(?xi: Reviewed-by:| Reported-by:| Suggested-by:| + Assisted-by:| To:| Cc: )};
@@ -737,7 +738,7 @@ sub find_standard_signature { my ($sign_off) = @_; my @standard_signature_tags = ( 'Signed-off-by:', 'Co-developed-by:', 'Acked-by:', 'Tested-by:', - 'Reviewed-by:', 'Reported-by:', 'Suggested-by:' + 'Reviewed-by:', 'Reported-by:', 'Suggested-by:', 'Assisted-by:' ); foreach my $signature (@standard_signature_tags) { return $signature if (get_edit_distance($sign_off, $signature) <= 2);
@@ -3105,6 +3106,15 @@ sub process { } } +# Assisted-by: uses format AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2] instead of email + if ($sign_off =~ /^assisted-by:$/i) { + if ($email !~ /^[^:]+:\S+(\s+\S+)*$/) { + WARN("BAD_ASSISTED_BY", + "Assisted-by: should use format: 'Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]'\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 "") {
Signature · 1 line
2.53.0
Quoted 31 lines · Harry Wentland
The
coding-assistants.rstdocumentation 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 sparseExamples of tags triggering the new warning:
- Claude coccinelle sparse
- JustAName
- :missing-agentCc Jonathan Corbet <[email protected]>Cc Jani Nikula <[email protected]>Assisted-by Claude:claude-opus-4.6Co-developed-by Alex Hung <[email protected]>Signed-off-by Alex Hung <[email protected]>Signed-off-by Harry Wentland <[email protected]>
Quoted 3 lines
--- scripts/checkpatch.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
Given that people are running into this problem, and that we *do* want people using that tag, it would make sense to go ahead and get this in, perhaps even with a CC: stable. Would you like me to route it Linusward, or did you have another path in mind?
Joe, does this look good to you?
Thanks,
jon
Joe Perches
maintainerQuoted 38 lines · Jonathan Corbet
Harry Wentland <[[email protected]](mailto:[email protected])> writes:
The
coding-assistants.rstdocumentation defines the Assisted-by: tagQuoted 30 lines
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 sparseExamples of tags triggering the new warning:
- Claude coccinelle sparse
- JustAName
- :missing-agentCc Jonathan Corbet <[[email protected]](mailto:[email protected])>Cc Jani Nikula <[[email protected]](mailto:[email protected])>Assisted-by Claude:claude-opus-4.6Co-developed-by Alex Hung <[[email protected]](mailto:[email protected])>Quoted 3 lines
--- scripts/checkpatch.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
Quoted 6 lines
Given that people are running into this problem, and that we *do* want people using that tag, it would make sense to go ahead and get this in, perhaps even with a CC: stable. Would you like me to route it Linusward, or did you have another path in mind?
Joe, does this look good to you?
Looks good.
If you want to take it and push it, fine by me.
Quoted 44 lines · Joe Perches
Quoted 43 lines · Jonathan Corbet
Harry Wentland <[[email protected]](mailto:[email protected])> writes:
The
coding-assistants.rstdocumentation defines the Assisted-by: tagQuoted 30 lines
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 sparseExamples of tags triggering the new warning:
- Claude coccinelle sparse
- JustAName
- :missing-agentCc Jonathan Corbet <[[email protected]](mailto:[email protected])>Cc Jani Nikula <[[email protected]](mailto:[email protected])>Assisted-by Claude:claude-opus-4.6Co-developed-by Alex Hung <[[email protected]](mailto:[email protected])>Quoted 3 lines
--- scripts/checkpatch.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)Given that people are running into this problem, and that we *do* want people using that tag, it would make sense to go ahead and get this in, perhaps even with a CC: stable. Would you like me to route it Linusward, or did you have another path in mind?
Quoted 5 lines
Quoted 1 line
Joe, does this look good to you?
Looks good.
If you want to take it and push it, fine by me.
OK, I have applied it, will ship it upward before too long.
Thanks,
jon