Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1575798rwb; Thu, 8 Dec 2022 12:25:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf4SW4yJwPelwUjHBCzjDc/1muo/sILYy6rPwkyDm0I9xiLr9j4jRbAxEDJFA+PDDd4JywWW X-Received: by 2002:a17:90a:c383:b0:219:5997:fb0a with SMTP id h3-20020a17090ac38300b002195997fb0amr44291372pjt.109.1670531145104; Thu, 08 Dec 2022 12:25:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670531145; cv=none; d=google.com; s=arc-20160816; b=emw+TvOZnhqXEnnb7slqHvvMVrzmpzDul3cFHBKDxZGzV8g2f+GUWUtxj38hlbcOv2 a0tsBJEl8nouXoI50zc1IpditF0DHigClvbkr9bqLy5FqDzR+E9fH1IWWFkU/i9U6TaQ ncOvcv9epfhgT68ugQPXpNN12arnlxJLqE74IAWe7cIE90WQoQgXkDjGPEy32CkbZKzG QRPtII7Ju3WqmtEI7/m3LPRRO9XpNOhLSAY8rW/EHlVQoKGaoJAP0NOP8yoS94Pp6RMC z/YMCK5A6e0MnreK4b4h/PSYRXJpGv7TWMp1n8pUIUaxTJPG8YJD/xnyqauXAHD10/5U 0vDA== 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=gBohD436/G8JcYo4PYH+exm3+2KDY8528Q6B2hJJGWs=; b=WMdaW/M4VuUzx8JqRN2dQd2L+XfXXuF6oImAyARpONcmVI+N8q3eNnctYYk4fFR8V3 Ugp2ShOq13dw8lXi5DgRl1cvtfGKRyNL7w1sZBCXtnOooFR2wAjALzoERCH4MQ5CTgWG Vez/czJmmMtQhzOEz4T6JLVoTtpCFCdanairwtI0JN/7qOEWusYBZQFN/XgHMfop2+ZQ LiO8mF5XvNvvylrz1jb+WPUwBr5Fnum23NMdhpbotgyG8nWMYawuOJz6hSoY+0l2WbTt 59rUolpv9HQ8k4mPgUflwLgkQhN+ms8KnXLIZObFbe+yMNNZZv2gOLxikU7CAABUSZa8 fj4g== 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 d10-20020a17090a6a4a00b00218e451806dsi122980pjm.39.2022.12.08.12.25.34; Thu, 08 Dec 2022 12:25:45 -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 S229556AbiLHUWF convert rfc822-to-8bit (ORCPT + 75 others); Thu, 8 Dec 2022 15:22:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbiLHUV5 (ORCPT ); Thu, 8 Dec 2022 15:21:57 -0500 Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6551E186EA for ; Thu, 8 Dec 2022 12:21:56 -0800 (PST) Received: from omf08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8AAC880C73; Thu, 8 Dec 2022 20:21:54 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA id 0708B20027; Thu, 8 Dec 2022 20:21:50 +0000 (UTC) Message-ID: <3953eb4913bf9b5610854624c4c632e710cd1ec9.camel@perches.com> Subject: Re: [PATCH 2/2] 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, 08 Dec 2022 12:21:50 -0800 In-Reply-To: <4af6cd7f0833f18e9eee8caba1913e682c5ec071.1670527774.git.kai@dev.carbon-project.org> References: <4af6cd7f0833f18e9eee8caba1913e682c5ec071.1670527774.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: rspamout04 X-Rspamd-Queue-Id: 0708B20027 X-Stat-Signature: j5k8sgrmcu75hwdfzkbseua4tdzyxyjt 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/YVhSE+ihJj0vummOmnovpWEljgE6P5Xc= X-HE-Tag: 1670530910-641128 X-HE-Meta: U2FsdGVkX181QdevkTFaY+KaBvX6D0nW5i2dEOJdh/h4CaE8sb267r7G6XwMJfjXaeJ8MM/VqPZbbws8eadouQ== 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-08 at 20:32 +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. Those links > are often extremely useful for any code archaeologist that wants to know > more about the backstory of a change than the commit message provides. > That includes maintainers higher up in the patch-flow hierarchy, which > is why Linus asks developers to add such links [1, 2, 3]. To quote [1]: > > > Again, the commit has a link to the patch *submission*, which is > > almost entirely useless. There's no link to the actual problem the > > patch fixes. > > > > [...] > > > > Put another way: I can see that > > > > Reported-by: Zhangfei Gao > > > > in the commit, but I don't have a clue what the actual report was, and > > there really isn't enough information in the commit itself, except for > > a fairly handwavy "Device drivers might, for instance, still need to > > flush operations.." > > > > I don't want to know what device drivers _might_ do. I would want to > > have an actual pointer to what they do and where. > > Another reason why these links are wanted: the ongoing regression > tracking efforts can only scale with them, as they allow the regression > tracking bot 'regzbot' to automatically connect tracked reports with > patches that are posted or committed to fix tracked regressions. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3144,6 +3144,20 @@ sub process { > "Co-developed-by and Signed-off-by: name/email do not match \n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); I believe this use of '"$here\n" . $rawline . "\n"' to be a defect. I think this should just use $herecurr And the unnecessary space before a newline is an abomination ;) "Co-developed-by and Signed-off-by: name/email do not match\n" . $herecurr . $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" . "$here\n" . $rawline); > + } elsif ($rawlines[$linenr] !~ /^\s*link:\s*(.*)/i) { > + WARN("BAD_REPORTED_BY_LINK", > + "Reported-by: should be immediately followed by Link: to the report\n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); > + } elsif ($lines[$linenr] !~ /https?:\/\//i) { > + WARN("BAD_REPORTED_BY_LINK", > + "Link: following Reported-by: should contain an URL\n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); Please use a space before and after a string concatenation '.' English generally uses "a URL" and not "an URL" https://www.techtarget.com/whatis/feature/Which-is-correct-a-URL-or-an-URL Also the actual link line should likely be from lore So maybe: } elsif ($lines[$linenr] !~ m{https?://lore.kernel.org/.+}i) { WARN("BAD_REPORTED_BY_LINK", "Link: following Reported-by: should use a lore.kernel.org URL\n" . $herecurr . $rawlines[$linenr]); etc...