Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1059866rwb; Thu, 8 Dec 2022 06:20:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf71zXkOxBECjLnXJAQ1OpMvD7Z1FRYROJpR+eb53HtU1Oeww9o+Vb2pvIBOkyzSIhDc/kc6 X-Received: by 2002:a05:6a00:1bce:b0:565:b4fe:de85 with SMTP id o14-20020a056a001bce00b00565b4fede85mr77214715pfw.81.1670509258748; Thu, 08 Dec 2022 06:20:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670509258; cv=none; d=google.com; s=arc-20160816; b=DzlWo9M6ZpZbASKerFrrH+jZrZFRVk1Wx48pvSkI0aF74lP2YDbwKhKn4JIL6eazYk eGEgS2pq/RuY5iMGmMbF+G0ArdkRbmPgE8jGQxSFciLS7JTq5T2e+ya8ppTAA+IoNCRL 0m3QVQo5CM8LPlb1OK8BdX9ZcruvgW9SH+ZFegX0gdbmfiYNhmvup0aPrFfJtosbShkz Q0en1O9eDQI+vjrL7WqIi2BsHfBVBGA0Che13ePxYY/u7JSnnaIkoe0tPt0g0uXTaOBJ h+UUm6k23dCQ1Jt3hDLEU+YGXCny98KgouHF6mjRdhsjObD2pbeCWQmNU0E/d2eUgqxr PZhg== 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=e9kmJD9NmCqiyVgkKhw+hk6wWqqDhsmTeNEEtQ6ykTg=; b=cig4+uusSWX8+xbNWgGtR2AZ0BaPCdk+9VJPovZ6+1LkmxZbLc4QFlCZ/cjslqomKl 09mGLuD6YQBVoZbbCIO4ox4F4LKEvcNQYG0NFtj/g1gNCiXzTUq3ITHSmbc3Db7Uoa8c m/jq6WLU+xTJ1inngscARlbRP3+I5v9QoZrSdNPYywbj84tvSSHfCRXn1YHoTb7TrNkf WJ/VTojZqE+CTyWmMzLXrA/95RIDQ6CR9qxhsgd9GhLL8Y57GUswZxXyKK3HvAl3K+G+ 8wesiGIqtPEbYhQvEv7Ul5uh3VpMD2t5tptrd6xdCR07ll/SFfq1I+YXA0japvfp95A6 51jw== 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 t14-20020aa7938e000000b00576abbc404esi13317579pfe.238.2022.12.08.06.20.49; Thu, 08 Dec 2022 06:20:58 -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 S230258AbiLHNTD (ORCPT + 72 others); Thu, 8 Dec 2022 08:19:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbiLHNSo (ORCPT ); Thu, 8 Dec 2022 08:18:44 -0500 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 300B894911 for ; Thu, 8 Dec 2022 05:18:33 -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 1p3GnH-0001Jh-5K; Thu, 08 Dec 2022 14:18:31 +0100 Message-ID: Date: Thu, 8 Dec 2022 14:18:30 +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 Cc: LKML , Andrew Morton , =?UTF-8?Q?Kai_Wasserb=c3=a4ch?= References: <20221205131424.36909375d90d5a40cd028bc0@linux-foundation.org> <11a9fe60f5333a931b8d75f67808b6d923c16dfa.camel@perches.com> <25f4838b-208a-cf8c-914c-b2092665d56f@leemhuis.info> <23a61dd072ee1d2cc5b54281b0a9dc13e01aa0b8.camel@perches.com> <9958a748-2608-8ed2-6e8f-2f3291286271@leemhuis.info> <15f7df96d49082fb7799dda6e187b33c84f38831.camel@perches.com> From: Thorsten Leemhuis Subject: Re: Fw: [PATCH 0/2] feat: checkpatch: prohibit Buglink: and warn about missing Link: In-Reply-To: <15f7df96d49082fb7799dda6e187b33c84f38831.camel@perches.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1670505513;a6c52991; X-HE-SMSGID: 1p3GnH-0001Jh-5K X-Spam-Status: No, score=-2.2 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 06.12.22 10:21, Joe Perches wrote: > On Tue, 2022-12-06 at 09:50 +0100, Thorsten Leemhuis wrote: >> On 06.12.22 08:44, Joe Perches wrote: >>> On Tue, 2022-12-06 at 08:17 +0100, Thorsten Leemhuis wrote: >>>> On 06.12.22 07:27, Thorsten Leemhuis wrote: >>>>> On 06.12.22 06:54, Joe Perches wrote: >>> [] >>>>>> and perhaps a more >>>>>> generic, "is the thing in front of a URI/URL" a known/supported entry, >>>>>> instead of using an known invalid test would be a better mechanism. >>>>> >>>>> Are you sure about that? It's not that I disagree completely, but it >>>>> sounds overly restrictive to me and makes it harder for new tags to >>>>> evolve in case we might want them. >>> >>> It's easy to add newly supported values to a list. >>> >>>>> And what tags would be on this allow-list? Anything else then "Link" and >>>>> "Patchwork"? Those are the ones that looked common and valid to me when >>>>> I ran >>>>> >>>>> git log --grep='http' v4.0.. | grep http | grep -v ' Link: ' | less >>>>> >>>>> and skimmed the output. Maybe "Datasheet" should be allowed, too -- not >>>>> sure. >>> [] >>>>> But I found a few others that likely should be on the disallow list: >>>>> "Closes:", "Bug:", "Gitlab issue:", "References:", "Ref:", "Bugzilla:", >>>>> "RHBZ:", and "link", as "Link" should be used instead in all of these >>>>> cases afaics. >>> >>> Do understand please that checkpatch will never be perfect. >>> At best, it's just a guidance tool. >> >> Of course -- and that's actually a reason why I prefer a disallow list >> over an allow list, as that gives guidance in the way of "don't use this >> tag, use Link instead" instead of enforcing "always use Link: when >> linking somewhere" (now that I've written it like that it feels even >> more odd, because it's obvious that it's a link, so why bother with a >> tag; but whatever). >> >> I also think the approach with a disallow list will not bother >> developers much, while the other forces them a bit to much into a scheme. >> >>> To me most of these are in the noise level, but perhaps all should just >>> use Link: >>> >>> $ git log -100000 --format=email -P --grep='^\w+:[ \t]*http' | \ >>> grep -Poh '^\w+:[ \t]*http' | \ >>> sort | uniq -c | sort -rn >>> 103889 Link: http >>> 415 BugLink: http >>> 372 Patchwork: http >>> 270 Closes: http >>> 221 Bug: http >>> 121 References: http >>> 101 v1: http >>> 77 Bugzilla: http >>> 60 URL: http >>> 59 v2: http >>> 37 Datasheet: http >>> 35 v3: http >>> 19 v4: http >>> 12 v5: http > >> Ha, I considered doing something like that when I wrote my earlier mail, >> but was to lazy. :-D thx! >> >> Yeah, they are not that often, but I grew tired arguing about that, >> that's why I think checkpatch is the better place and in the better >> position to handle that. > > I'm not sure that "Patchwork:" is a reasonable prefix. > Is that documented anywhere? > >> Anyway, so how to move forward now? Do you insist on a allow list (IOW: >> a Link: or Patchwork: before every http...)? Or is a disallow list with >> the most common unwanted tags for links (that you thankfully compiled) >> fine for you as well? > > Maybe > --- > scripts/checkpatch.pl | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 1c3d13e65c2d0..a526a354cdfbc 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -3250,6 +3250,13 @@ sub process { > $commit_log_possible_stack_dump = 0; > } > > +# Check for odd prefixes before a URI/URL > + if ($in_commit_log && > + $line =~ /^\s*(\w+):\s*http/ && $1 !~ /^(?:Link|Patchwork)/) { > + WARN("PREFER_LINK", > + "Unusual link reference '$1:', prefer 'Link:'\n" . $herecurr); > + } > + One more thing: That afaics would result in a warning when people use things like "v1: https://example.com/somewhere", which some people apparently like. Those imho are not considered tags, hence I'd say we allow them, unless you disagree. Ciao, Thorsten