Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1321036rdb; Fri, 20 Oct 2023 15:35:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIrf1Lsbe0VgN76HycQXW2Bk8uzHUMbcDRbQMVT+uKBsup2N75qsQxuJFIQb/odIjbkpcz X-Received: by 2002:a17:90a:c087:b0:27e:277:3015 with SMTP id o7-20020a17090ac08700b0027e02773015mr3215159pjs.16.1697841335802; Fri, 20 Oct 2023 15:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697841335; cv=none; d=google.com; s=arc-20160816; b=y+cgdnlSaTKYQNd5l+jydLgLzBMi5kM6b5lb8bbyJ9R2xvFHjoQRSWH0z6xn7NyB1q zaY067qLWnht1c0QnO/lG2gzOYNATeH4E7QBMBotZ8N3gRDiVybxB6O17I2JiY02Zlpw y7v5jXCOJ0g3jk79KDJRdhV2zWWbq82ChNevQjl9eChzOF2FW28MnIIKwTbOGpx9rY/o kP1mSNGGiNiKIuffwxMWJJ80bqki+2r1Noft7QPdJG/9aUnvokgoU/vo0FqOiRK7Qhl9 ybMQmjcssBYQESAFbLgJDMC7FRPCbkrRw/10YjZOwgIkIhd9mGEO9yYIVFpZtcJ+ziuj HBaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=8ozCvBojwdHQO2VexnBjnGg4c05i6KIHrEwq1PAqudE=; fh=K1yoK3N9FJ783mohxcndGW1LqwxV1xQNkOGg1+Q3bSA=; b=BEqRmKoI34hClsNWWgVXZ+ib2yCx5X5+cWTPTc5NerU9q7Rxfx7/vdKb7IHH56gtbo Ha9YfN1qbvQrcpFntN2Mt4qfWDpgtI5X4lL6cnN9eA0VdLBOMkTt0tkByA2SCXzlLdgj IAJbJdSsC8IeXiAUAx1OW9fD4nrNlJRLfJT0XOVMeLN++HcuQBXyw7sBsKxShsm5M+ks 2SvvrShp+pUCGNhgb+VR+N0ClbW+q7CsXB3/lmB3S9T/tFMdcJF9aTMRKrnhDeDlucI6 0DFWoL5TgB2jySBOnvyx7OFoXs7u9Q8P3p6P/UCer1TvGDEwZrt/BNbyN6F6ebO4O7Gs y2ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id 5-20020a17090a018500b00263e299dff6si2727382pjc.74.2023.10.20.15.35.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 15:35:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id DA626807616F; Fri, 20 Oct 2023 15:35:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230294AbjJTWev convert rfc822-to-8bit (ORCPT + 99 others); Fri, 20 Oct 2023 18:34:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230281AbjJTWeu (ORCPT ); Fri, 20 Oct 2023 18:34:50 -0400 Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20B4891 for ; Fri, 20 Oct 2023 15:34:45 -0700 (PDT) Received: from omf11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A1C8480233; Fri, 20 Oct 2023 22:34:43 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA id 6F1CB2002F; Fri, 20 Oct 2023 22:34:41 +0000 (UTC) Message-ID: Subject: Re: [PATCH] checkpatch: allow tags between co-developed-by and their sign-off From: Joe Perches To: Przemek Kitszel , Andy Whitcroft , Dwaipayan Ray , Lukas Bulwahn , linux-kernel@vger.kernel.org Cc: Jacob Keller Date: Fri, 20 Oct 2023 15:34:40 -0700 In-Reply-To: <20231020132156.37882-1-przemyslaw.kitszel@intel.com> References: <20231020132156.37882-1-przemyslaw.kitszel@intel.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Rspamd-Queue-Id: 6F1CB2002F X-Spam-Status: No, score=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Rspamd-Server: rspamout06 X-Stat-Signature: ejx1fdsi4p19nyntrhqe4nitqku94cta X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX192xNY8g1V4VJHRbK/KkJ93xdgnr/pv91c= X-HE-Tag: 1697841281-109740 X-HE-Meta: U2FsdGVkX1/CJ6MPuslSjj72SWELfX+WrEQUXANFi+dkvn/6BM4rMZQ0XwrplW7GyMF27wNGSPLyqMU37ZGgH0Mw7UnGC4i7QkcMt/phT6OfrvK59oQJjLYluE7cSAnmVkyO9Zz7qfBIOWAf4SzQwuzfodpmHT35LoFqp8Vol4kp0RtadzunbhtJNoE0R0yGjVIhxQ/4uHGvCu0kG1oHcW+mzOa4m4twg/JIJqYCAqv+39PAw+tDu9TEDjUUqpM61lSu3RLYEy9Ns5E0pP3o9qn+PgymcFvYeiIqv29emCmnJOnkSVsninCTrf0aI8KQwHk2typc8uKYEheqFOzAdzFRQM+N/K1jSsuvgke8G/Qplc5ecFh9LSIUGOou3NA5 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 20 Oct 2023 15:35:09 -0700 (PDT) On Fri, 2023-10-20 at 15:21 +0200, Przemek Kitszel wrote: > Allow additional tags between Co-developed-by: and Signed-off-by:. > Bump severity of missing SoB to ERROR. > > Additional tags between Co-developed-by and corresponding Signed-off-by > could include Reviewed-by tags collected by Submitter, which is also > a Co-developer, but should sign-off at the very end of tags provided by > themself. > > Missing SoB is promoted to error while that piece of code is touched. > > Two sets of perl %hashes introduced to keep both (int) line numbers and > (string) messages handy for warning reporting, while keeping it correct > across 100+ line long commit messages. > > Mateusz Polchlopek has reported this to me. > > Reviewed-by: Jacob Keller > Signed-off-by: Przemek Kitszel Unless this is accepted by various process folk, and the documentation for it updated, I think this should not be applied. > --- > scripts/checkpatch.pl | 36 +++++++++++++++++++++++------------- > 1 file changed, 23 insertions(+), 13 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 7d16f863edf1..0400bf092bfa 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -2682,6 +2682,10 @@ sub process { > my $suppress_statement = 0; > > my %signatures = (); > + my %signoffs = (); > + my %signoffs_msg = (); > + my %codevs = (); > + my %codevs_msg = (); > > # Pre-scan the patch sanitizing the lines. > # Pre-scan the patch looking for any __setup documentation. > @@ -2967,11 +2971,13 @@ sub process { > if ($line =~ /^\s*signed-off-by:\s*(.*)/i) { > $signoff++; > $in_commit_log = 0; > + my $ctx = $1; > + $signoffs{$ctx} = $linenr; > + $signoffs_msg{$ctx} = $herecurr; > if ($author ne '' && $authorsignoff != 1) { > - if (same_email_addresses($1, $author)) { > + if (same_email_addresses($ctx, $author)) { > $authorsignoff = 1; > } else { > - my $ctx = $1; > my ($email_name, $email_comment, $email_address, $comment1) = parse_email($ctx); > my ($author_name, $author_comment, $author_address, $comment2) = parse_email($author); > > @@ -3158,22 +3164,15 @@ sub process { > $signatures{$sig_nospace} = 1; > } > > -# Check Co-developed-by: immediately followed by Signed-off-by: with same name and email > +# Collect Co-developed-by: to check if each is backed up by Signed-off-by: with > +# the same name and email. Checks are made after main loop. > if ($sign_off =~ /^co-developed-by:$/i) { > if ($email eq $author) { > WARN("BAD_SIGN_OFF", > "Co-developed-by: should not be used to attribute nominal patch author '$author'\n" . $herecurr); > } > - if (!defined $lines[$linenr]) { > - WARN("BAD_SIGN_OFF", > - "Co-developed-by: must be immediately followed by Signed-off-by:\n" . $herecurr); > - } elsif ($rawlines[$linenr] !~ /^signed-off-by:\s*(.*)/i) { > - WARN("BAD_SIGN_OFF", > - "Co-developed-by: must be immediately followed by Signed-off-by:\n" . $herecurr . $rawlines[$linenr] . "\n"); > - } elsif ($1 ne $email) { > - WARN("BAD_SIGN_OFF", > - "Co-developed-by and Signed-off-by: name/email do not match\n" . $herecurr . $rawlines[$linenr] . "\n"); > - } > + $codevs{$email} = $linenr; > + $codevs_msg{$email} = $herecurr; > } > > # check if Reported-by: is followed by a Closes: tag > @@ -7712,6 +7711,17 @@ sub process { > "From:/Signed-off-by: email subaddress mismatch: $sob_msg\n"); > } > } > + # check if each Co-developed-by tag is backed up by Sign-off, > + # warn if Co-developed-by tag was put after a Signed-off-by tag > + foreach my $codev (keys %codevs) { > + if (!$signoffs{$codev}) { > + ERROR("BAD_SIGN_OFF", > + "Co-developed-by: must be followed by Signed-off-by:\n" . $codevs_msg{$codev}); > + } elsif ($signoffs{$codev} <= $codevs{$codev}) { > + WARN("BAD_SIGN_OFF", > + "Co-developed-by: must be followed by Signed-off-by:, but was placed after it\n" . $signoffs_msg{$codev} . $codevs_msg{$codev}); > + } > + } > } > > print report_dump();