Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1467174rwb; Thu, 15 Dec 2022 10:22:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf642DMx+ng8EaJU/dLQmdjUc5dCLJKMRjriVmkngMZ3LPspkk7xsIbTpwGMy9zGaltwz1PI X-Received: by 2002:a05:6a20:d48f:b0:9d:efbe:a0f5 with SMTP id im15-20020a056a20d48f00b0009defbea0f5mr35949936pzb.5.1671128569554; Thu, 15 Dec 2022 10:22:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671128569; cv=none; d=google.com; s=arc-20160816; b=y3aui71SbIOk94wNNGDKmwiOTtIC3GtWSoYP5KofgZXgqPresUMV2hxmPpxPQQ3MLM gHcKFjmZJ+pEBi8hIRkEnZQ7y6DuoW3vXgXpIBJZqs1Bv6kfrUyagNVMecuMOkpQubNb mDABZg7CyBpOwENR35lc2IEhCP+4zhaE4warZBhd/5wCUBkM75v3bT+9q/XIODvD1LbQ In3MPxOWM0vIZTcF3HG5Odd2qb7/VqTl01aifO3Oekx3l5IDRnWZVYLIKrJra70LobRH jueQQODh3AvB6mRq8qRYSrF7gEnVQDuKyJa82bQqbHIG+uRyCD4sDkgJUYnMBibCiPG2 aiew== 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=Sh9dSCe+/Z9zWhh4/e14W4c6LikTQgJe+Vxuh/QhnAo=; b=Dkyd+W1HSFeLxjWvvMKxAoo57IHz8uA+ImidrQ/GUEDAmhBbqhveO5fJzIsF3nwKG2 P1hP+n8URJzv8geCZBC+kMJg3u83DQar8Jx0pOB5J9JtkQ2XkzH0dYa+JhdsdxRzLPBA e3Rp6ngChEFlyghWJShwCzSYKCs142jZ3cIgxN/cmS5XZiHPjFjeUA9YMzQteDKNm4z0 FBg8pADBanoztuMbQZjiUreVznsiyCSchBtdLIR9ow2EDj5D6a+JoxnbIVW4xaUFcLwQ TXNQ58JLUsX5ezZ2TepvhTS2wymoZmA6ryfoDfvEvz/OZZX7WlzEI3g+4mur+0UUFj0o V0Gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x62-20020a17090a6c4400b0021939584595si5511275pjj.82.2022.12.15.10.22.40; Thu, 15 Dec 2022 10:22:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229947AbiLOSAT convert rfc822-to-8bit (ORCPT + 68 others); Thu, 15 Dec 2022 13:00:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbiLOSAQ (ORCPT ); Thu, 15 Dec 2022 13:00:16 -0500 Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BACE3F05C for ; Thu, 15 Dec 2022 10:00:14 -0800 (PST) Received: from omf18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 0C0CAAB79A; Thu, 15 Dec 2022 18:00:13 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA id B76A52E; Thu, 15 Dec 2022 18:00:10 +0000 (UTC) Message-ID: Subject: Re: [PATCH 2/3] checkpatch: warn when Reported-by: is not followed by Link: From: Joe Perches To: Kai =?ISO-8859-1?Q?Wasserb=E4ch?= , linux-kernel@vger.kernel.org Cc: Thorsten Leemhuis , Andrew Morton , Andy Whitcroft , Dwaipayan Ray , Lukas Bulwahn Date: Thu, 15 Dec 2022 10:00:09 -0800 In-Reply-To: <26b72b039d4150418cd37598d50112719c684344.1671114724.git.kai@dev.carbon-project.org> References: <26b72b039d4150418cd37598d50112719c684344.1671114724.git.kai@dev.carbon-project.org> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Rspamd-Server: rspamout06 X-Rspamd-Queue-Id: B76A52E X-Stat-Signature: 6jr9em953bwxb9jtfw3smfxqj4y8tzuc X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+gtDP41/sSKyDObTGbJCbYLcRcqhgg2e8= X-HE-Tag: 1671127210-72073 X-HE-Meta: U2FsdGVkX1/TN02vMQFc5OFMaOrgL/Fsv9Q991Mf07+0CLgHopqCpBU8idSvdXnExdr8rvp3QRROtp3AEb+MtA== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2022-12-15 at 15:43 +0100, Kai Wasserb?ch wrote: > Encourage patch authors to link to reports by issuing a warning, if > a Reported-by: is not accompanied by a link to the report. Please also expand Documentation/ as appropriate to encourage this too. > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3155,6 +3155,20 @@ sub process { > "Co-developed-by and Signed-off-by: name/email do not match \n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); > } > } > + > + # check if Reported-by: is followed by a Link: > + if ($sign_off =~ /^reported-by:$/i) { > + if (!defined $lines[$linenr]) { > + WARN("BAD_REPORTED_BY_LINK", > + "Reported-by: should be immediately followed by Link: to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); > + } elsif ($rawlines[$linenr] !~ /^\s*link:\s*(.*)/i) { This capture group isn't necessary and does not guarantee there is an actual link. Also this is allowing spaces before "Link:" when the reported-by test above does not allow spaces. Please be consistent. My preference would be to not allow spaces. > + WARN("BAD_REPORTED_BY_LINK", > + "Reported-by: should be immediately followed by Link: to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); > + } elsif ($lines[$linenr] !~ /https?:\/\//i) { To make reading the match pattern easier, prefer m{} when the expected content uses / instead of using / as a delimiter. > + WARN("BAD_REPORTED_BY_LINK", > + "Link: following Reported-by: should contain a URL\n" . $herecurr . $rawlines[$linenr] . "\n"); > + } > + } > } > > # Check Fixes: styles is correct