Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp843131rwl; Fri, 31 Mar 2023 03:16:27 -0700 (PDT) X-Google-Smtp-Source: AKy350atTKaqF3XFMnucvCP+9ouE4fqMrW9yTJETG14DAOvW5WRMiQcLhxMip71o0j9TXDcN+fNv X-Received: by 2002:a05:6402:268e:b0:502:1f7b:f0a6 with SMTP id w14-20020a056402268e00b005021f7bf0a6mr27621927edd.0.1680257786972; Fri, 31 Mar 2023 03:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680257786; cv=none; d=google.com; s=arc-20160816; b=pF4en15jjPfo8S6TmDoWTjmaQxTOV9rRj7hbG2ZooSqySP2lYxF/4GDJBVIwJClBAk bthpqNy3ro/4WlJK4t1oz1Qj5X0B+2hvG1bxi15W/sIDW215GlGROzQ8iSyYVyqM9OCN KoyVfw+KjqWNgTtiZ2R/HskWuqzxAR8ab55dMl28AV13eCfECUX2CemUuJQzW+X3dBu1 59ztuwdTtLW4xbhsHXH9v1zXL1Alexf+m+Kq6Y6qG6Ur8av8wV+p08VQlrydSpoYPYsW GkY0pXlnfKzHGDGBv/ouBM1mr3K4K6ql7H6ZlVGfanBaEkVv1ijuKbyXK9Z4BWqiERp7 pVEw== 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=JeUMNPl8KU5v0km9PYJyWHYqKGePyFazUAMSxvDTqe4=; b=hesAwYruxORwe8TJRkkJ6x1FlTdQE6DpK/BvQJVnScAT/KJhn0kV1JFKt9sOtEEBdk 0HZunp2Ntu4auFK3NnVcQbiIP37HneelX4V9KVo04iHMw67H1OPmwCrJqq6Us24zn8wf yL8R5UuElJz4jCRoaYJknZEpL8WPOBBMC216nn5dfkXTNf1jOasZNuC6KycuG2/HgCyF bS5uN+h3dJ79uguzPXbdvpyTW9hRAOUvW7msrT+j1yE0xzgD/yNTpRZua5zu9GPmuVV1 D+AuiaV7zC/dJd9z2W9x/j8J/iScy4CqQEFnepZUQ5Gfddm4Cvm1WilmLwXZGLdIp6x7 N2Qw== 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 i15-20020aa7dd0f000000b004fd2b05171csi1843818edv.153.2023.03.31.03.16.00; Fri, 31 Mar 2023 03:16:26 -0700 (PDT) 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 S231445AbjCaKPC (ORCPT + 99 others); Fri, 31 Mar 2023 06:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231134AbjCaKOK (ORCPT ); Fri, 31 Mar 2023 06:14:10 -0400 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D1BE40EB; Fri, 31 Mar 2023 03:09:53 -0700 (PDT) Received: from [2a02:8108:8980:2478:8cde:aa2c:f324:937e]; authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1piBhb-0001bz-Qs; Fri, 31 Mar 2023 12:09:47 +0200 Message-ID: Date: Fri, 31 Mar 2023 12:09:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Content-Language: en-US, de-DE To: Matthieu Baerts , Jonathan Corbet , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , =?UTF-8?Q?Kai_Wasserb=c3=a4ch?= , Andrew Morton , David Airlie , Daniel Vetter , Konstantin Ryabitsev , Bagas Sanjaya , Linus Torvalds Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, mptcp@lists.linux.dev References: <20230314-doc-checkpatch-closes-tag-v3-0-d1bdcf31c71c@tessares.net> <20230314-doc-checkpatch-closes-tag-v3-4-d1bdcf31c71c@tessares.net> From: Thorsten Leemhuis Subject: Re: [PATCH v3 4/4] checkpatch: check for misuse of the link tags In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1680257393;4699f220; X-HE-SMSGID: 1piBhb-0001bz-Qs X-Spam-Status: No, score=-0.0 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 31.03.23 11:44, Matthieu Baerts wrote: > Hi Thorsten, > > On 31/03/2023 10:57, Thorsten Leemhuis wrote: >> On 30.03.23 20:13, Matthieu Baerts wrote: >>> "Link:" and "Closes:" tags have to be used with public URLs. >>> >>> It is difficult to make sure the link is public but at least we can >>> verify the tag is followed by 'http(s):'. >>> >>> With that, we avoid such a tag that is not allowed [1]: >>> >>> Closes: >>> >>> Link: https://lore.kernel.org/linux-doc/CAHk-=wh0v1EeDV3v8TzK81nDC40=XuTdY2MCr0xy3m3FiBV3+Q@mail.gmail.com/ [1] >>> Signed-off-by: Matthieu Baerts >>> [...] >>> +# Check for misuse of the link tags >>> + if ($in_commit_log && >>> + $line =~ /^\s*(\w+:)\s*(\S+)/) { >>> + my $tag = $1; >>> + my $value = $2; >>> + if ($tag =~ /^$link_tags_search$/ && $value !~ /^https?:/) { >>> + WARN("COMMIT_LOG_WRONG_LINK", >>> + "'$tag' should be followed by a public http(s) link\n" . $herecurr); >>> + } >>> + } >>> + >> >> I must be missing something here, but it looks to me like this is >> checked twice now. See this line in patch2 (which is changed there, but >> the check itself remains): >> >>> } elsif ($rawlines[$linenr] !~ m{^link:\s*https?://}i) { > > If I'm not mistaken, we had the following checks: > > - after Reported-by, there is a link tag (Link:|Closes:) > > - (link tags can take more than 75 chars) > - tags followed by "http(s)://" are restricted to link ones > > Then not: link tags (Link:|Closes:) are followed by "http(s):". Not in general, afaics -- and ensuring that is likely wise, so thx for this. But for Link: and Closes: tags after a Reported-by it is already checked, that's what I meant (and didn't communicate well, sorry). It's just a detail, but might be wise to do this in patch 4: - } elsif ($rawlines[$linenr] !~ m{^$link_tags_search\s*https?://}i) { + } elsif ($rawlines[$linenr] !~ m{^$link_tags_search}i) { (that's a line changed in patch2) Ciao, Thorsten