From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753391AbdLGQ1G (ORCPT ); Thu, 7 Dec 2017 11:27:06 -0500 Received: from smtprelay0157.hostedemail.com ([216.40.44.157]:37104 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753187AbdLGQ1E (ORCPT ); Thu, 7 Dec 2017 11:27:04 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2197:2199:2393:2559:2562:2828:2915:3138:3139:3140:3141:3142:3354:3622:3653:3865:3867:3868:3870:3871:3872:3874:4321:5007:10004:10400:10848:11026:11232:11473:11658:11914:12043:12555:12740:12760:12895:13149:13230:13439:14181:14659:14721:21080:21221:21433:21451:21627:30022:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: shake61_32fa4a07000c X-Filterd-Recvd-Size: 3471 Message-ID: <1512664018.960.45.camel@perches.com> Subject: Re: [PATCH] checkpatch: add check for tag Co-Developed-by From: Joe Perches To: "Tobin C. Harding" , Andy Whitcroft Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman Date: Thu, 07 Dec 2017 08:26:58 -0800 In-Reply-To: <1512608376-4234-1-git-send-email-me@tobin.cc> References: <1512608376-4234-1-git-send-email-me@tobin.cc> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-12-07 at 11:59 +1100, Tobin C. Harding wrote: > Recently signature tag Co-Developed-by was added to the > kernel (Documentation/process/5.Posting.rst). checkpatch.pl doesn't know > about it yet. All prior tags used all lowercase characters except for first > character. Checks for this format had to be re-worked to allow for the > new tag. > > Add checkpatch checks for Co-Developed-by tag. This patch is not extensible. If this is to be done at all, the Co-Developed-by: should not be a special case because a new and different one might be added in the future. Better to verify that a case insensitive match exists in $signature_tags and then complain if the match is not exact. > Cc: Greg Kroah-Hartman > Signed-off-by: Tobin C. Harding > --- > scripts/checkpatch.pl | 22 ++++++++++++++++------ > 1 file changed, 16 insertions(+), 6 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 040aa79e1d9d..a7d2cdcec6a6 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -468,6 +468,7 @@ our $signature_tags = qr{(?xi: > Reviewed-by:| > Reported-by:| > Suggested-by:| > + Co-Developed-by:| > To:| > Cc: > )}; > @@ -2468,6 +2469,8 @@ sub process { > my $space_after = $3; > my $email = $4; > my $ucfirst_sign_off = ucfirst(lc($sign_off)); > + my $preferred_signature = ""; > + my $co_dev_by_tag = 'Co-Developed-by:'; > > if ($sign_off !~ /$signature_tags/) { > WARN("BAD_SIGN_OFF", > @@ -2481,15 +2484,22 @@ sub process { > "$ucfirst_sign_off $email"; > } > } > - if ($sign_off =~ /-by:$/i && $sign_off ne $ucfirst_sign_off) { > - if (WARN("BAD_SIGN_OFF", > - "'$ucfirst_sign_off' is the preferred signature form\n" . $herecurr) && > - $fix) { > - $fixed[$fixlinenr] = > - "$ucfirst_sign_off $email"; > + if ($sign_off =~ /$co_dev_by_tag$/i) { > + if ($sign_off ne $co_dev_by_tag) { > + $preferred_signature = $co_dev_by_tag; > } > + } elsif ($sign_off =~ /-by:$/i && $sign_off ne $ucfirst_sign_off) { > + $preferred_signature = $ucfirst_sign_off; > > } > + > + if ($preferred_signature ne "") { > + my $prefix = "'$preferred_signature' is the preferred signature form\n"; > + if (WARN("BAD_SIGN_OFF", $prefix . $herecurr) && $fix) { > + $fixed[$fixlinenr] = "$ucfirst_sign_off $email"; > + } > + } > + > if (!defined $space_after || $space_after ne " ") { > if (WARN("BAD_SIGN_OFF", > "Use a single space after $ucfirst_sign_off\n" . $herecurr) &&