From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED83E35DA44 for ; Thu, 26 Mar 2026 23:59:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774569573; cv=none; b=KJbzEjaA7fAejaVyyslp8X7gIDfgba6FTh8sd91GVF6gQYOdQhw/Q/z1DeGHDcVGw6COnQHg+am3HgFhhTQO/vMOIl0j0V6xvgMOFm0HxeO72zD+CSOrSUmj23h/OnAj1NrfnseEIz5a6zKPnAQMletW6NCfe6DkQRfWaVI7NmY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774569573; c=relaxed/simple; bh=LW29Uy170s78D24IFjn3YzXPRv+TKzK8GZznsmYVtD0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=E/fOqDm3bmaSDZg89g6YQSvnAFYtnWiRjAwd9HzbuoFeazVLSk6xwssr/V7VUfhnE7t+/dd+bxg08z6Ez9+hpcEYEzTaR/YbW+ZQSUpJsI7d4o+fCu3N1TIK7005JAZIsDEvrHvs6rZA7T6dIVVW2crlzkT8txi/CFuTolt8lOg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com; spf=pass smtp.mailfrom=perches.com; arc=none smtp.client-ip=216.40.44.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=perches.com Received: from omf15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AD8A7E105A; Thu, 26 Mar 2026 23:59:30 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf15.hostedemail.com (Postfix) with ESMTPA id 5BF5A17; Thu, 26 Mar 2026 23:59:28 +0000 (UTC) Message-ID: <76b7238d447fd4ef91936f2b49d2d3d27ef76525.camel@perches.com> Subject: Re: [PATCH] scripts/checkpatch: add Assisted-by: tag validation From: Joe Perches To: Harry Wentland , apw@canonical.com, linux-kernel@vger.kernel.org Cc: dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com, Jonathan Corbet , Jani Nikula Date: Thu, 26 Mar 2026 16:59:27 -0700 In-Reply-To: <20260326210508.996461-1-harry.wentland@amd.com> References: <20260326210508.996461-1-harry.wentland@amd.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Server: rspamout05 X-Rspamd-Queue-Id: 5BF5A17 X-Stat-Signature: jdaf15kgko1u81tx9ixbmcr9edoofi84 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+7FFLsHUE2FDrTZuso3EOuXsyJtPFv3UI= X-HE-Tag: 1774569568-476939 X-HE-Meta: U2FsdGVkX1/pyGhzyQ9ELrIN/jPiVoUA8kfjAssFNc0I63kM/vimW3eZpF5UrSylzEhHi/BHmcPUSY1jVIUZY7xYWwDB8yKwlqgoZpKQvwU1KrjwuBKbgn1hp3KorN4YBUPNm5S9oDbMJ0N/Gg3XRVgpZyrc+IZnJL31JiotML/xsE/WplqqPGymqHTbXEoIMMivTTT61Kx1r5m7CZylDMAUXaSl+urpxlNMAILcBt28st0eU3D3XxnK/nVkF4dQcHb75n7NAzg8wzDbSmBGqljk4mf/n0u+NUx2UYo3irxHegzUf/cKMTt/+fp7UyThCqYm8690Ey0VaZobrCBSsUiP6uhJP18a On Thu, 2026-03-26 at 17:05 -0400, Harry Wentland wrote: > ``` > The coding-assistants.rst documentation defines the Assisted-by: tag > format for AI-assisted contributions as: >=20 > Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2] >=20 > This format does not use an email address, so checkpatch currently > reports a false positive about an invalid email when encountering this > tag. >=20 > 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. The validation accepts AGENT_NAME with an optional > :MODEL_VERSION, If the documented form is as shown above, the MODEL_VERSION should not be optional and should at least emit a warning. > followed by optional tool names which may themselves > carry a colon-separated version. MODEL_VERSION containing dots triggers > a warning suggesting hyphens per convention. Why? Assisted-by: FOO:BAR.baz seems reasonable to me. What's already in the logs can be ignored. > Assisted-by: Claude:claude-opus-4-6 Why was anything assisting this? > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3105,88 +3106,99 @@ sub process { > } > } > =20 > - my ($email_name, $name_comment, $email_address, $comment) =3D parse_e= mail($email); > - my $suggested_email =3D format_email(($email_name, $name_comment, $em= ail_address, $comment)); > - if ($suggested_email eq "") { > - ERROR("BAD_SIGN_OFF", > - "Unrecognized email address: '$email'\n" . $herecurr); > +# Assisted-by: uses format AGENT_NAME[:MODEL_VERSION] [TOOL1[:VER]] [TOO= L2[:VER]] instead of email > + if ($sign_off =3D~ /^assisted-by:$/i) { > + if ($email !~ /^\S+(\s+\S+)*$/) { > + WARN("BAD_ASSISTED_BY", > + "Assisted-by: should use format: 'Assisted-by: AGENT_NAME[:MOD= EL_VERSION] [TOOL1[:VER]] [TOOL2[:VER]]'\n" . $herecurr); > + } elsif ($email =3D~ /^[^:\s]+:(\S+)/ && $1 =3D~ /\./) { > + WARN("BAD_ASSISTED_BY", > + "Assisted-by: MODEL_VERSION should use hyphens instead of dots= : '$email'\n" . $herecurr); > + } > } else { Perhaps all of the changes below should be removed and next used above > - my $dequoted =3D $suggested_email; > - $dequoted =3D~ s/^"//; > - $dequoted =3D~ s/" - # Don't force email to have quotes > - # Allow just an angle bracketed address > - if (!same_email_addresses($email, $suggested_email)) { > - if (WARN("BAD_SIGN_OFF", > - "email address '$email' might be better as '$suggested_email'\n" = . $herecurr) && > - $fix) { > - $fixed[$fixlinenr] =3D~ s/\Q$email\E/$suggested_email/; > + my ($email_name, $name_comment, $email_address, $comment) =3D parse_= email($email); > + my $suggested_email =3D format_email(($email_name, $name_comment, $e= mail_address, $comment)); > + if ($suggested_email eq "") { > + ERROR("BAD_SIGN_OFF", > + "Unrecognized email address: '$email'\n" . $herecurr); > + } else { > + my $dequoted =3D $suggested_email; > + $dequoted =3D~ s/^"//; > + $dequoted =3D~ s/" + # Don't force email to have quotes > + # Allow just an angle bracketed address > + if (!same_email_addresses($email, $suggested_email)) { > + if (WARN("BAD_SIGN_OFF", > + "email address '$email' might be better as '$suggested_email'\n"= . $herecurr) && > + $fix) { > + $fixed[$fixlinenr] =3D~ s/\Q$email\E/$suggested_email/; > + } > } > - } > =20 > - # Address part shouldn't have comments > - my $stripped_address =3D $email_address; > - $stripped_address =3D~ s/\([^\(\)]*\)//g; > - if ($email_address ne $stripped_address) { > - if (WARN("BAD_SIGN_OFF", > - "address part of email should not have comments: '$email_address'= \n" . $herecurr) && > - $fix) { > - $fixed[$fixlinenr] =3D~ s/\Q$email_address\E/$stripped_address/; > + # Address part shouldn't have comments > + my $stripped_address =3D $email_address; > + $stripped_address =3D~ s/\([^\(\)]*\)//g; > + if ($email_address ne $stripped_address) { > + if (WARN("BAD_SIGN_OFF", > + "address part of email should not have comments: '$email_address= '\n" . $herecurr) && > + $fix) { > + $fixed[$fixlinenr] =3D~ s/\Q$email_address\E/$stripped_address/; > + } > } > - } > =20 > - # Only one name comment should be allowed > - my $comment_count =3D () =3D $name_comment =3D~ /\([^\)]+\)/g; > - if ($comment_count > 1) { > - WARN("BAD_SIGN_OFF", > - "Use a single name comment in email: '$email'\n" . $herecurr); > - } > + # Only one name comment should be allowed > + my $comment_count =3D () =3D $name_comment =3D~ /\([^\)]+\)/g; > + if ($comment_count > 1) { > + WARN("BAD_SIGN_OFF", > + "Use a single name comment in email: '$email'\n" . $herecurr)= ; > + } > =20 > =20 > - # [stable@vger.kernel.org](mailto:stable@vger.kernel.org) or [stable= @kernel.org](mailto:stable@kernel.org) shouldn't > - # have an email name. In addition comments should strictly > - # begin with a # > - if ($email =3D~ /^.*stable\@(?:vger\.)?kernel\.org/i) { > - if (($comment ne "" && $comment !~ /^#.+/) || > - ($email_name ne "")) { > - my $cur_name =3D $email_name; > + # [stable@vger.kernel.org](mailto:stable@vger.kernel.org) or [stabl= e@kernel.org](mailto:stable@kernel.org) shouldn't > + # have an email name. In addition comments should strictly > + # begin with a # > + if ($email =3D~ /^.*stable\@(?:vger\.)?kernel\.org/i) { > + if (($comment ne "" && $comment !~ /^#.+/) || > + ($email_name ne "")) { > + my $cur_name =3D $email_name; > + my $new_comment =3D $comment; > + $cur_name =3D~ s/[a-zA-Z\s\-\"]+//g; > + > + # Remove brackets enclosing comment text > + # and # from start of comments to get comment text > + $new_comment =3D~ s/^\((.*)\)$/$1/; > + $new_comment =3D~ s/^\[(.*)\]$/$1/; > + $new_comment =3D~ s/^[\s\#]+|\s+$//g; > + > + $new_comment =3D trim("$new_comment $cur_name") if ($cur_name ne = $new_comment); > + $new_comment =3D " # $new_comment" if ($new_comment ne ""); > + my $new_email =3D "$email_address$new_comment"; > + > + if (WARN("BAD_STABLE_ADDRESS_STYLE", > + "Invalid email format for stable: '$email', prefer '$new_email'= \n" . $herecurr) && > + $fix) { > + $fixed[$fixlinenr] =3D~ s/\Q$email\E/$new_email/; > + } > + } > + } elsif ($comment ne "" && $comment !~ /^(?:#.+|\(.+\))$/) { > my $new_comment =3D $comment; > - $cur_name =3D~ s/[a-zA-Z\s\-\"]+//g; > =20 > - # Remove brackets enclosing comment text > - # and # from start of comments to get comment text > - $new_comment =3D~ s/^\((.*)\)$/$1/; > + # Extract comment text from within brackets or > + # c89 style /*...*/ comments > $new_comment =3D~ s/^\[(.*)\]$/$1/; > - $new_comment =3D~ s/^[\s\#]+|\s+$//g; > + $new_comment =3D~ s/^\/\*(.*)\*\/$/$1/; > =20 > - $new_comment =3D trim("$new_comment $cur_name") if ($cur_name ne $= new_comment); > - $new_comment =3D " # $new_comment" if ($new_comment ne ""); > - my $new_email =3D "$email_address$new_comment"; > + $new_comment =3D trim($new_comment); > + $new_comment =3D~ s/^[^\w]$//; # Single lettered comment with non = word character is usually a typo > + $new_comment =3D "($new_comment)" if ($new_comment ne ""); > + my $new_email =3D format_email($email_name, $name_comment, $email_= address, $new_comment); > =20 > - if (WARN("BAD_STABLE_ADDRESS_STYLE", > - "Invalid email format for stable: '$email', prefer '$new_email'\= n" . $herecurr) && > + if (WARN("BAD_SIGN_OFF", > + "Unexpected content after email: '$email', should be: '$new_emai= l'\n" . $herecurr) && > $fix) { > $fixed[$fixlinenr] =3D~ s/\Q$email\E/$new_email/; > } > } > - } elsif ($comment ne "" && $comment !~ /^(?:#.+|\(.+\))$/) { > - my $new_comment =3D $comment; > - > - # Extract comment text from within brackets or > - # c89 style /*...*/ comments > - $new_comment =3D~ s/^\[(.*)\]$/$1/; > - $new_comment =3D~ s/^\/\*(.*)\*\/$/$1/; > - > - $new_comment =3D trim($new_comment); > - $new_comment =3D~ s/^[^\w]$//; # Single lettered comment with non w= ord character is usually a typo > - $new_comment =3D "($new_comment)" if ($new_comment ne ""); > - my $new_email =3D format_email($email_name, $name_comment, $email_a= ddress, $new_comment); > - > - if (WARN("BAD_SIGN_OFF", > - "Unexpected content after email: '$email', should be: '$new_email= '\n" . $herecurr) && > - $fix) { > - $fixed[$fixlinenr] =3D~ s/\Q$email\E/$new_email/; > - } > } > } > =20 >=20 > ```