Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp1394183rwj; Sun, 18 Dec 2022 07:26:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf4AWXfYdCJ2JGCQLaS6u89SICFsPTlhfYRT5+EQI87DZu65GDdp+39WbJBzJfdIOOd/jJJT X-Received: by 2002:a17:907:7704:b0:7c1:79ce:a431 with SMTP id kw4-20020a170907770400b007c179cea431mr25303054ejc.25.1671377185935; Sun, 18 Dec 2022 07:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671377185; cv=none; d=google.com; s=arc-20160816; b=fBAlE8u3caCMcaxLGQvlVVfzDBAGC8aSVYkhbOs/uOCc9n14KkJk8EDk2pDwpeDR4j +S7I7zDTct2CPGSBFSyTETkyRz86+vhOVyXy/5j29z6DEqe+TszIpl/Zl4Gn1f1OpduR hOuhnnAZ72eYDGpNGBMDQ2i1lfW8/0F03ZsSJbCPL68JOGdG0v4jJ15J4y9E/4DD0KxA o3T3X3Z8DHGqIe+ONanbxrZts+QH1BUmdNUaBjSIxxa0GFSwqEU1I8cC1HzeDVVqR6iP IVemVvpHUoh0mQCKhN37b0tu66WqW40eUgDkpZMVaFb+XQNyxCYG4g6Yhyk8WahrwFrZ Bu+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id; bh=uxYg9AwZOsVs7PvKrvdEZGoURIlyaBhInnACnj9ljFc=; b=feMCbSEMHaNALGkAQjVoLoqRRXD2tOX9y0EmVqjAFemHizZGK9Nd8aJ/PCS2xxhCt1 9itOcXdnoW8fdxEZTjWM4OQmamf7ilJXYoXAOA9IuNrBu6MFsFcoKLwhZ7hN4+wbuhAQ J9YyJRPnkXqJQULjE2vob5TDNLlkU9GsZB94aUTxN39aJulwn0DfiyRnKjS5oUCO0M3t wC7Ig9N2ejBd4MDshe/jsiwYJqD8A3iNtKh/9PKRK95svlTMwYDCkeEfqcE/P6ZyEtx6 7zZdTu0MkmJOeCB2Gf9kl8zSZcyQaHeP7hnHy/skBtOZ55X/Oq9j7WVFqXSrbFO7e2m+ B6Nw== 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 p10-20020a170906838a00b006feb76dbd51si5139549ejx.289.2022.12.18.07.26.09; Sun, 18 Dec 2022 07:26:25 -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 S230503AbiLROyc (ORCPT + 70 others); Sun, 18 Dec 2022 09:54:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbiLROyY (ORCPT ); Sun, 18 Dec 2022 09:54:24 -0500 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7770EB1FD for ; Sun, 18 Dec 2022 06:54:21 -0800 (PST) Received: from [2a02:8108:963f:de38:eca4:7d19:f9a2:22c5]; authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1p6v3T-0000bm-1R; Sun, 18 Dec 2022 15:54:19 +0100 Message-ID: <90e3aaf8-91b1-8a16-16da-4a9c491d8579@leemhuis.info> Date: Sun, 18 Dec 2022 15:54:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Content-Language: en-US, de-DE To: Joe Perches , =?UTF-8?Q?Kai_Wasserb=c3=a4ch?= , linux-kernel@vger.kernel.org Cc: Andrew Morton , Andy Whitcroft , Dwaipayan Ray , Lukas Bulwahn References: <26b72b039d4150418cd37598d50112719c684344.1671114724.git.kai@dev.carbon-project.org> From: Thorsten Leemhuis Subject: Re: [PATCH 2/3] checkpatch: warn when Reported-by: is not followed by Link: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1671375261;e2ec4e69; X-HE-SMSGID: 1p6v3T-0000bm-1R X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 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 15.12.22 19:00, Joe Perches wrote: > 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. Well, I already updated it a few moths ago, but yeah, will revisit the docs and make it even clearer if needed (I assume that's the case). >> 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. Good idea. FWIW, the section patch 3 changes has a space here as well: ``` > } elsif ($rawlines[$linenr] !~ /^\s*signed-off-by:\s*(.*)/i) { ``` Hence I guess I'll remove it as well, unless you for some reason tell me that's a bad idea. >> + 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. Also a good idea. That being said: I think I'll drop this check, as your comment made me think: why should we check for "https?://" here at all? If we want to check that a "Link:" is followed by a URI, then we should do that all the time, not just in this single case. Or am I missing something? >> + WARN("BAD_REPORTED_BY_LINK", >> + "Link: following Reported-by: should contain a URL\n" . $herecurr . $rawlines[$linenr] . "\n"); >> + } >> + } >> } >> >> # Check Fixes: styles is correct Ciao, Thorsten