Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp848854rwl; Fri, 31 Mar 2023 03:22:49 -0700 (PDT) X-Google-Smtp-Source: AKy350a9FciKgk0OYTThQH5tfzn55LJg0kje7zXfBqplnRodW71bgJF2RhGrvc4tT6h5yWW2+ltN X-Received: by 2002:a17:906:18d:b0:92f:39d9:1e50 with SMTP id 13-20020a170906018d00b0092f39d91e50mr3729195ejb.3.1680258168899; Fri, 31 Mar 2023 03:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680258168; cv=none; d=google.com; s=arc-20160816; b=XGtF8JsK9TmQhsD/Hw7+q65nSq+ZjNPcOO7U17dvnhVAVbcZuVQuE396StrT0PrSEp mxJ6lXijSmlf+OcSTASNf20aC9TJ5jo+GWwRjepBSu1utoxxrtuj3pZB+S1CA4dmMDvJ c1f5GchgD+0qgC0zpRJ6kiQ1E8W4KAiEj8CiTHfkc944Bydjq7t92UK0fJLaZ7iyuaeC ZAjD8xrYrIM9UNVmOiiHG+BE3Sym2HQBPloWqC4GffnCIFd5044aTqTk4l8hDerEk0sV JNu+ARp/Q5vbfQR1ehc413z0vtAqGyb4CEOG0941dpbSfYJk5p6tgn6AiKHue7OkeUGW aQpg== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=RLyeL0ieC0af03HsrJcBtZcl6Qcrr61FaS5vG8SSolU=; b=PKSUWVBAMovXNXbr497WxAiyoq6kfzt3l7ah7DVUgArUEtygcd/k8xUcMUTc7b1p0j SZrdqTuGJNN5mFs3u1h7fqGpPfVXf1Pqmqrgus3GhOqu41PuLbX400nuVR0FsNj8KG+U EIPbufJRoFiSTUetd7KA1hfD8pTfdo8wLWArQDuLoKIHu6YgKqAbfGgGBU3KA4NyutFF GJGPp36VBaUDP25kCgyIHeFm/dRNsf5rqmgN+qL6X/3XhuMdxW9TqPa8IhuBXZIC8Kz4 lMv6+5WU5CzFtXfLpMcj4W74Dgk3ZQR5MpsATor1pWnru6JswR4O+GlIeK05yIpgUtLg UGBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=n7VgHm1i; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kw2-20020a170907770200b0091fe6232debsi1849559ejc.293.2023.03.31.03.22.23; Fri, 31 Mar 2023 03:22:48 -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; dkim=pass header.i=@tessares.net header.s=google header.b=n7VgHm1i; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231253AbjCaKVS (ORCPT + 99 others); Fri, 31 Mar 2023 06:21:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231293AbjCaKUo (ORCPT ); Fri, 31 Mar 2023 06:20:44 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 717331DFB2 for ; Fri, 31 Mar 2023 03:16:17 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id h8so87624739ede.8 for ; Fri, 31 Mar 2023 03:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1680257776; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RLyeL0ieC0af03HsrJcBtZcl6Qcrr61FaS5vG8SSolU=; b=n7VgHm1iogUci/YDlLwqbiCQxOh0NTv+S+qLJr9YmfYegjQWmoHTp0Cklpblqu5bsJ iaGtyYJwJwKuULk5G/jHZB7UgH1yEM2IrW9H5dQjSUwWnbvuAHA/kFU3q2NS5lPpzqRa YVmS8BLqjrTpztRer9bqdMiB35T4WfhCrR/o8wi0Lk7b4c+q7aPRgmpZQ5YYJkje8+Ev GlmyLmlrq65oTOn6ecRqiyzSQXlnwgiAVeCpy4yeEpvLO5iWElYQqyq+v54qBcF67eBP D5U8sCdHoyM9THhL3t5k6uu9kAidFR1UbuMVrrsfGZP7T8hXIayuCJMC4LRxGnCc6m1j V7Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680257776; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RLyeL0ieC0af03HsrJcBtZcl6Qcrr61FaS5vG8SSolU=; b=ZjxA57Vvs/nDkKuBni1KO1yA++GjP2NQjNwOPCE0uNEM5cC7OLzDm+sgRR700Btp2B oeGkC5rkXy2CGqCqRfPd/ZF/p50w6Jt4Jm4MKRDI8xHm6T0E6MyRh3KZqF67dKZO8j2a 31m79NS+pRKgek/Tlw1lPlDYSP3dkzRYo4RysXy8ySFbuRI+pCNNM8aL1EkB50aXcjBe lDV3gAMK6PPu1M0EJSzFi9UuDOTcRtPFy8AZKPIfWLxpLCjFpOV9cW2qrsyYzIwMrv9m QFWcNw+m9IUcy5TtpsbkxNG0rekUoaLml+Ml/aAQz2PCIenF57KIdbO0pxuqxtJQucMm G6uw== X-Gm-Message-State: AAQBX9dLwn2MuAQgINkIS2ZMnNO6t9q9x0uJQe6TiVyC5VE0IK1KOXeP i7o+d1vz+++R0aJqfMZlAREtPw== X-Received: by 2002:a17:906:44b:b0:931:624b:680c with SMTP id e11-20020a170906044b00b00931624b680cmr26590099eja.29.1680257775893; Fri, 31 Mar 2023 03:16:15 -0700 (PDT) Received: from [10.44.2.5] ([81.246.10.41]) by smtp.gmail.com with ESMTPSA id c4-20020a170906170400b0093f0fbebfc2sm817144eje.144.2023.03.31.03.16.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Mar 2023 03:16:15 -0700 (PDT) Message-ID: <2370614d-6d9a-9f35-63a3-cfdcca2dd0c2@tessares.net> Date: Fri, 31 Mar 2023 12:16:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 4/4] checkpatch: check for misuse of the link tags Content-Language: en-GB To: Thorsten Leemhuis , 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: Matthieu Baerts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 Hi Thorsten, On 31/03/2023 12:09, Thorsten Leemhuis wrote: > > > 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) OK thank you. Sorry I didn't get that. Indeed, it should be enough to just check for the tags, not for the "http(s)://" part. Cheers, Matt -- Tessares | Belgium | Hybrid Access Solutions www.tessares.net