Received: by 10.223.185.116 with SMTP id b49csp2961571wrg; Mon, 5 Mar 2018 11:31:29 -0800 (PST) X-Google-Smtp-Source: AG47ELtAuv+/CIx7UqvXOt5yTRARr0gi5MeSul+zB7ktWIAU+uyHiZelOft3vY58WAFlN1ozAfYF X-Received: by 10.99.168.75 with SMTP id i11mr12861229pgp.420.1520278289144; Mon, 05 Mar 2018 11:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520278289; cv=none; d=google.com; s=arc-20160816; b=xPaMgAaSGyy8BVuqyYTeV4QcHxit5LmJMzpxykaUgFbn42PaeNmkJDwFOoQ1qw0VSf p37vxSg5ZCUeWOynqqNlXNm8Z0kfKN/2sTAAhlkdFStydMErQHUXZF+TDL+OSlFc3U2z aHi+zD6tzYG4jHmSOqSuCQVEH+nrqulOT6XPvFl7tgb7k0ZiyuogKRn2eTPDSKawW8xH ljvmLjEDRspFaCNLlFMXGmhljO5e2vvyVV/sC0TRuYFo56Obuy0qqfvKKjPH/AeTQzO4 8X04pt7UDQiqTqIU2F/ocHWg5DDHXoAUTWYL0UznK4Sc4FO+MrL00wVPO9Yt/Z5COU5f kYmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=MLHXS5wMlAHO9sVj4Eq9JzjQntYsZh6QqmWRw5j4OUM=; b=kllp6w7hFI/4WL0/NTiSRAkUYFBEDda0XQFh3T6IF3SZ9gmyj+M0+qy0cLB1/FS8jm QTXiZdjGjT4i7YgaySzAeBYfOwRsW5K+FfWM9W1HuSNF71MFSg8pdEhKCkWLhOVmFHO3 NXSiJELSdBUW+K16S2p+uz+kAvUg+yNnH6+hbLsqx71Ei60vkB4EAVHrihhpSiOMrDwT aqAVzqBoxYFWgCpyN3F1d4Gzcc41s8dq6VwhEar6OZqytNDFClHKLBvuNZcX0ENQB+Bo 0M5IVsCnby8IYcI/ExcDDqFMgejL5QlFSDyudlLCNp2GePu/MCVEeExGh4hnfVZJXzrV 2k0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9si3021254pgq.815.2018.03.05.11.31.13; Mon, 05 Mar 2018 11:31:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752953AbeCET3l (ORCPT + 99 others); Mon, 5 Mar 2018 14:29:41 -0500 Received: from smtprelay0217.hostedemail.com ([216.40.44.217]:44833 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751490AbeCET3j (ORCPT ); Mon, 5 Mar 2018 14:29:39 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 5080D181D341E; Mon, 5 Mar 2018 19:29:38 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:69:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2197:2198:2199:2200:2393:2559:2562:2828:3138:3139:3140:3141:3142:3355:3622:3653:3865:3867:3871:3872:4321:5007:7576:7653:7903:8957:10004:10400:10848:11026:11232:11473:11658:11914:12043:12291:12438:12555:12683:12740:12760:12895:13439:14181:14659:14721:21080:21221:21433:21627:21740:30022:30054:30070:30091,0,RBL:109.168.25.226:@perches.com:.lbl8.mailshell.net-62.8.122.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: fifth01_199b7b6968e3a X-Filterd-Recvd-Size: 4905 Received: from XPS-9350 (226.25.168.109.dsl.static.ip.kpnqwest.it [109.168.25.226]) (Authenticated sender: joe@perches.com) by omf10.hostedemail.com (Postfix) with ESMTPA; Mon, 5 Mar 2018 19:29:35 +0000 (UTC) Message-ID: <1520278173.25605.16.camel@perches.com> Subject: Re: [PATCH 1/2] checkpatch: add check for tag Co-Developed-by From: Joe Perches To: "Tobin C. Harding" , Andrew Morton , Greg Kroah-Hartman Cc: Randy Dunlap , Dominik Brodowski , Thomas Gleixner , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Date: Mon, 05 Mar 2018 11:29:33 -0800 In-Reply-To: <1520222301-11874-2-git-send-email-me@tobin.cc> References: <1520222301-11874-1-git-send-email-me@tobin.cc> <1520222301-11874-2-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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-03-05 at 14:58 +1100, Tobin C. Harding wrote: > From: Joe Perches I still think this "Co-Developed-by" stuff is unnecessary. > 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. > > Cc: Greg Kroah-Hartman > > Reviewed-by: Greg Kroah-Hartman > Signed-off-by: Tobin C. Harding > --- > scripts/checkpatch.pl | 58 +++++++++++++++++++++++++++++++-------------------- > 1 file changed, 35 insertions(+), 23 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 3d4040322ae1..fbe2ae2d035f 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -461,16 +461,18 @@ our $logFunctions = qr{(?x: > seq_vprintf|seq_printf|seq_puts > )}; > > -our $signature_tags = qr{(?xi: > - Signed-off-by:| > - Acked-by:| > - Tested-by:| > - Reviewed-by:| > - Reported-by:| > - Suggested-by:| > - To:| > - Cc: > -)}; > +our @valid_signatures = ( > + "Signed-off-by:", > + "Acked-by:", > + "Tested-by:", > + "Reviewed-by:", > + "Reported-by:", > + "Suggested-by:", > + "Co-Developed-by:", > + "To:", > + "Cc:" > +); > +my $signature_tags = "(?x:" . join('|', @valid_signatures) . ")"; > > our @typeListMisordered = ( > qr{char\s+(?:un)?signed}, > @@ -2193,6 +2195,17 @@ sub pos_last_openparen { > return length(expand_tabs(substr($line, 0, $last_openparen))) + 1; > } > > +sub get_preferred_sign_off { > + my ($sign_off) = @_; > + > + foreach my $sig (@valid_signatures) { > + if (lc($sign_off) eq lc($sig)) { > + return $sig; > + } > + } > + return ""; > +} > + > sub process { > my $filename = shift; > > @@ -2499,35 +2512,34 @@ sub process { > my $sign_off = $2; > my $space_after = $3; > my $email = $4; > - my $ucfirst_sign_off = ucfirst(lc($sign_off)); > + my $preferred_sign_off = ucfirst(lc($sign_off)); > > - if ($sign_off !~ /$signature_tags/) { > + if ($sign_off !~ /$signature_tags/i) { > WARN("BAD_SIGN_OFF", > "Non-standard signature: $sign_off\n" . $herecurr); > - } > - if (defined $space_before && $space_before ne "") { > + } elsif ($sign_off !~ /$signature_tags/) { > + $preferred_sign_off = get_preferred_sign_off($sign_off); > if (WARN("BAD_SIGN_OFF", > - "Do not use whitespace before $ucfirst_sign_off\n" . $herecurr) && > + "'$preferred_sign_off' is the preferred signature form\n" . $herecurr) && > $fix) { > - $fixed[$fixlinenr] = > - "$ucfirst_sign_off $email"; > + $fixed[$fixlinenr] = "$preferred_sign_off $email"; > } > } > - if ($sign_off =~ /-by:$/i && $sign_off ne $ucfirst_sign_off) { > + if (defined $space_before && $space_before ne "") { > if (WARN("BAD_SIGN_OFF", > - "'$ucfirst_sign_off' is the preferred signature form\n" . $herecurr) && > + "Do not use whitespace before $preferred_sign_off\n" . $herecurr) && > $fix) { > $fixed[$fixlinenr] = > - "$ucfirst_sign_off $email"; > + "$preferred_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) && > + "Use a single space after $preferred_sign_off\n" . $herecurr) && > $fix) { > $fixed[$fixlinenr] = > - "$ucfirst_sign_off $email"; > + "$preferred_sign_off $email"; > } > } >