From patchwork Mon Apr 3 16:23:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 78634 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2435093vqo; Mon, 3 Apr 2023 09:36:55 -0700 (PDT) X-Google-Smtp-Source: AKy350afi60rBrKHcxTNnabjZv9DOKYzIDXmSTPrj/UGZ5BzN82yJCc5KN1AomiFCo7y4aVjadZN X-Received: by 2002:a17:906:4786:b0:946:a1c8:e000 with SMTP id cw6-20020a170906478600b00946a1c8e000mr28468011ejc.44.1680539814793; Mon, 03 Apr 2023 09:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680539814; cv=none; d=google.com; s=arc-20160816; b=mTwyNr4KtJOW0G6A55FQ2WoFioC+KaZE7sIB7R7DZMme4/SzdzOMyUMMD0PHDQBe1d A09pi4ix79LiRtiVJeL60WsQNwUsbFdD+9/nhRxk6sf5ygzgGYtYnHlPD4+OOoTrs1hc B0FOXzVZ2FZFJLKecwjSzmE59nzp9TFp7N9kJkwPAXuF1MHc0wdx/5wpRK7bkUSFS6pl aEuc+eyyFigTIYtEYlGens91PPuitgdiWKmEGOn0X0pBn4NWEW4Dcc9PIqb0kSnnQqwG I6w/Y2wJBX/DpqtCySN5HXCH3imV3fgoPiMoSD8Ftw+1LUeLA4FZt9dax7a/D31cpTBo VTKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ivRFBbBLsT8PENrIOkpzsl3GjnJNYg5q8GytdSeJd/M=; b=XsK/NUNCaoFXH0VQPO4bUjXsij4+32wHvUhtxjUsH9jkdaOQ9hM6ySYy6PsPurGZTX jTcYtlkUPVzCXijC4CaGgdhETJnPJ5b5mai8jcdFfnmIh+qRzrvWEVwg9FQctovMzqD4 CwXO98JR4LGUfzwqE/EkNpSxfS3b55ZukMaAfVX4znrnXithlVBlvv6hr1P4ZAhIfKTW s3bahHICBdRH5RADhQeQmMQNUJ4dyeFWspTH1vTZo6RMEzQgafxwlmFXGLl9FTSnNCtx SqtA9JtzFjnQuS8xlPx1WuxMMvkeZMkkqJTBiUkhMgok1f3EH6s6LrNWLKDW8c3m1kVn E44A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=IOuF0a5u; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ia2-20020a170907a06200b0093defbd626esi464406ejc.1013.2023.04.03.09.36.31; Mon, 03 Apr 2023 09:36:54 -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=IOuF0a5u; 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 S232662AbjDCQYE (ORCPT + 99 others); Mon, 3 Apr 2023 12:24:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232657AbjDCQXy (ORCPT ); Mon, 3 Apr 2023 12:23:54 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 221C91FC1 for ; Mon, 3 Apr 2023 09:23:52 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id hg25-20020a05600c539900b003f05a99a841so549573wmb.3 for ; Mon, 03 Apr 2023 09:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1680539030; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ivRFBbBLsT8PENrIOkpzsl3GjnJNYg5q8GytdSeJd/M=; b=IOuF0a5uQ725wwgMaBOFJ1CIGIRMg0a9KPi6cU98t148Vl6+7OmVj3m4vuTchlNe4m ln5xNXcFJU7d/HfsdPdeYRXw87unX5BBGGmdXJ9dclX2NyTTRSjF68Y4WrSmDrwjQiI5 NaP9sbOeRS4z8Z93HPVwO4uzOI4YdvS77w18+QXTDjIg9yhgxOfkaHpE1QRmHzoYDG/O 50ZrgcLW3tpGg8CtVVmzU74njAoc+resf07vqVwJgQb2iasFhttyESDcpeTOyQTYmqOr CaXy0jl4cdU3DwcsMEz24jxJNfaYy6IDekqlrjD96ajWpXt3ErCjGjoEcNLeBpSoQFXm PVPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680539030; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ivRFBbBLsT8PENrIOkpzsl3GjnJNYg5q8GytdSeJd/M=; b=FRBOuWlkdGOkktHJnKN0bkbodujZP7X7l2+sSl6pXmnTXwR4bR1C0lfAf3StwM3e3+ qDqNIoxOMEtM56vuYk6VG7vzDFcl9y4ChJ1sbze1QJqq8JfXgDe9n8hI2QBGQn29ohpW v4ZdsgiaNss4TUt56uHFMH0mtgzvp5Ijm8uEArZSubFmLto9ILns2S1yjVKaCaxEazkB f1YM/XwAwdEKflmWMFlYR/VXC92J2jlKvSsP3JfPdbufb4xlxLI6H9dIj2SDkTLsBlgM qPDHRM4xBIxoYM91AgRFkLBKKzlfgk7vH0MBHtqL2DIY39IW565zQeGGUdRIcmiaYRJp pOzw== X-Gm-Message-State: AAQBX9fSUfLPKNzorURA0DWT9RnA1DXKVREmPOFMozg1aK1CInv36L0K 0VwLuCdtVFMiAjKvK+VJT/Ymkg== X-Received: by 2002:a7b:ca57:0:b0:3ed:95a5:3257 with SMTP id m23-20020a7bca57000000b003ed95a53257mr83037wml.2.1680539030512; Mon, 03 Apr 2023 09:23:50 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id s7-20020a05600c45c700b003ee2a0d49dbsm19829116wmo.25.2023.04.03.09.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 09:23:50 -0700 (PDT) From: Matthieu Baerts Date: Mon, 03 Apr 2023 18:23:46 +0200 Subject: [PATCH v4 1/5] docs: process: allow Closes tags with links MIME-Version: 1.0 Message-Id: <20230314-doc-checkpatch-closes-tag-v4-1-d26d1fa66f9f@tessares.net> References: <20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net> In-Reply-To: <20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net> To: Jonathan Corbet , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , =?utf-8?q?Kai_Wasserb=C3=A4ch?= , Thorsten Leemhuis , 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, Matthieu Baerts X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=10687; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=CkDFVa9AtDJkV6ivMyRE3U4PFtLS27wF3tz/1GHYQv0=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkKv2TsAdkWH3G3vfoLHKBkzL+HAaPOCj2pvJ3X McK7SVIDPOJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZCr9kwAKCRD2t4JPQmmg c5RCEADf8ycEKlMSTQFtUaePef5o8obyK4vywLLXq5jZ3fLrvLSrHhNQeoWc4UtR5gK3GUwKvbb ZrnMUDIhMWNL10vtutD85fKxLMkM/zLxtu9ZStR87lztFG94GgSnN/lOzRobVDLx6bkY30XuVw6 3s4q1fsqa+nvILN2m++4Ya4Cv96AnJ6uhAyF1AA3QQw+Ld3vwEWcrrKG9qzOR9YKwiB2PweT0Jz Kep+owaTn1DfkzWPiHYAFizo0rL3cuQQsvo265itWrMQov82zNYc+b1G1Wr2vnXSerVnfFI8TGr S25SMciVp4CLzH/Re01nJhA1GAfRyirUd0zHUtHgwUZHWVLovT6tOkmGX0V8OnGbDvKGam0ME6R uaGWvRnXIUFRJnOopQ2SSTxWWLLq0d1KWkSJtQPquh8Bt0CoEZNxDGzKB9vdw+lWiHLHZyR37zE WAJKuHXUx8afiXMOzq35NUIP+AG7Sfmt5iuz7dIZoTPQClQ5STN8RxyBEmG8fD81DKq8pmzvseQ UaU6uefcXzDrgrJ2BtWwn47XK6G/7joq3r63toQa46miW83FK630s6hUGWKJlb8AJ8oRfqfm/AG d90TvmnlkY803/UKXpEDjOoh40or1fARp8XzNHhd3+c/PJEP5HD78yjrv0DGZRBNbk9kwUZprTX VUBBS0zr49vQKzQ== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762173716641182456?= X-GMAIL-MSGID: =?utf-8?q?1762173716641182456?= Making sure a bug tracker is up to date is not an easy task. For example, a first version of a patch fixing a tracked issue can be sent a long time after having created the issue. But also, it can take some time to have this patch accepted upstream in its final form. When it is done, someone -- probably not the person who accepted the patch -- has to remember about closing the corresponding issue. This task of closing and tracking the patch can be done automatically by bug trackers like GitLab [1], GitHub [2] and hopefully soon [3] bugzilla.kernel.org when the appropriated tag is used. The two first ones accept multiple tags but it is probably better to pick one. According to commit 76f381bb77a0 ("checkpatch: warn when unknown tags are used for links"), the "Closes" tag seems to have been used in the past by a few people and it is supported by popular bug trackers. Here is how it has been used in the past: $ git log --no-merges --format=email -P --grep='^Closes: http' | \ grep '^Closes: http' | cut -d/ -f3-5 | sort | uniq -c | sort -rn 391 gitlab.freedesktop.org/drm/intel 79 github.com/multipath-tcp/mptcp_net-next 8 gitlab.freedesktop.org/drm/msm 3 gitlab.freedesktop.org/drm/amd 2 gitlab.freedesktop.org/mesa/mesa 1 patchwork.freedesktop.org/series/73320 1 gitlab.freedesktop.org/lima/linux 1 gitlab.freedesktop.org/drm/nouveau 1 github.com/ClangBuiltLinux/linux 1 bugzilla.netfilter.org/show_bug.cgi?id=1579 1 bugzilla.netfilter.org/show_bug.cgi?id=1543 1 bugzilla.netfilter.org/show_bug.cgi?id=1436 1 bugzilla.netfilter.org/show_bug.cgi?id=1427 1 bugs.debian.org/625804 Likely here, the "Closes" tag was only properly used with GitLab and GitHub. We can also see that it has been used quite a few times (and still used recently) and this is then not a "random tag that makes no sense" like it was the case with "BugLink" recently [4]. It has also been misused but that was a long time ago, when it was common to use many different random tags. checkpatch.pl script should then stop complaining about this "Closes" tag. As suggested by Thorsten [5], if this tag is accepted, it should first be described in the documentation. This is what is done here in this patch. To avoid confusion, the "Closes" should be used with any public bug report. No need to check if the underlying bug tracker supports automations. Having this tag with any kind of public bug reports allows bots like regzbot to clearly identify patches fixing a specific bug and avoid false-positives, e.g. patches mentioning it is related to an issue but not fixing it. As suggested by Thorsten [6] again, if we follow the same logic, the "Closes" tag should then be used after a "Reported-by" one. Note that thanks to this "Closes" tag, the mentioned bug trackers can also locate where a patch has been applied in different branches and repositories. If only the "Link" tag is used, the tracking can also be done but the ticket will not be closed and a manual operation will be needed. Also, these bug trackers have some safeguards: the closure is only done if a commit having the "Closes:" tag is applied in a specific branch. It will then not be closed if a random commit having the same tag is published elsewhere. Also in case of closure, a notification is sent to the owners. Link: https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#default-closing-pattern [1] Link: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests [2] Link: https://lore.kernel.org/linux-doc/20230315181205.f3av7h6owqzzw64p@meerkat.local/ [3] Link: https://lore.kernel.org/all/CAHk-=wgs38ZrfPvy=nOwVkVzjpM3VFU1zobP37Fwd_h9iAD5JQ@mail.gmail.com/ [4] Link: https://lore.kernel.org/all/688cd6cb-90ab-6834-a6f5-97080e39ca8e@leemhuis.info/ [5] Link: https://lore.kernel.org/linux-doc/2194d19d-f195-1a1e-41fc-7827ae569351@leemhuis.info/ [6] Link: https://github.com/multipath-tcp/mptcp_net-next/issues/373 Suggested-by: Thorsten Leemhuis Acked-by: Konstantin Ryabitsev Signed-off-by: Matthieu Baerts --- v4: - The "Closes" tag should be used for any bug report. Then also always after a "Reported-by" tag. (Thorsten Leemhuis) v3: - Allow using the "Closes" tag with any bug reports, not only the ones supporting automations, useful for regzbot, etc. (Thorsten Leemhuis) v2: - Add Konstantin's Acked-by: even if the patch has changed a bit, the concept is still the same, I hope that's OK. - Mention "public" in "5.Posting.rst" file as well. (Jonathan Corbet) - Re-phrase the new text from "5.Posting.rst". (Bagas Sanjaya & Thorsten Leemhuis) - Clearly mention that private bug trackers and invalid URLs are forbidden (Linus Torvalds). --- Documentation/process/5.Posting.rst | 22 +++++++++++++++++----- Documentation/process/submitting-patches.rst | 26 ++++++++++++++++++-------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/Documentation/process/5.Posting.rst b/Documentation/process/5.Posting.rst index 7a670a075ab6..de4edd42d5c0 100644 --- a/Documentation/process/5.Posting.rst +++ b/Documentation/process/5.Posting.rst @@ -207,8 +207,8 @@ the patch:: Fixes: 1f2e3d4c5b6a ("The first line of the commit specified by the first 12 characters of its SHA-1 ID") Another tag is used for linking web pages with additional backgrounds or -details, for example a report about a bug fixed by the patch or a document -with a specification implemented by the patch:: +details, for example an earlier discussion which leads to the patch or a +document with a specification implemented by the patch:: Link: https://example.com/somewhere.html optional-other-stuff @@ -217,7 +217,17 @@ latest public review posting of the patch; often this is automatically done by tools like b4 or a git hook like the one described in 'Documentation/maintainer/configure-git.rst'. -A third kind of tag is used to document who was involved in the development of +If the URL points to a public bug report being fixed by the patch, use the +"Closes:" tag instead:: + + Closes: https://example.com/issues/1234 optional-other-stuff + +Some bug trackers have the ability to close issues automatically when a +commit with such a tag is applied. Some bots monitoring mailing lists can +also track such tags and take certain actions. Private bug trackers and +invalid URLs are forbidden. + +Another kind of tag is used to document who was involved in the development of the patch. Each of these uses this format:: tag: Full Name optional-other-stuff @@ -251,8 +261,10 @@ The tags in common use are: - Reported-by: names a user who reported a problem which is fixed by this patch; this tag is used to give credit to the (often underappreciated) people who test our code and let us know when things do not work - correctly. Note, this tag should be followed by a Link: tag pointing to the - report, unless the report is not available on the web. + correctly. Note, this tag should be followed by a Closes: tag pointing to + the report, unless the report is not available on the web. The Link: tag + can be used instead of Closes: if the patch fixes a part of the issue(s) + being reported. - Cc: the named person received a copy of the patch and had the opportunity to comment on it. diff --git a/Documentation/process/submitting-patches.rst b/Documentation/process/submitting-patches.rst index 828997bc9ff9..12d58ddc2b8a 100644 --- a/Documentation/process/submitting-patches.rst +++ b/Documentation/process/submitting-patches.rst @@ -113,11 +113,9 @@ there is no collision with your six-character ID now, that condition may change five years from now. If related discussions or any other background information behind the change -can be found on the web, add 'Link:' tags pointing to it. In case your patch -fixes a bug, for example, add a tag with a URL referencing the report in the -mailing list archives or a bug tracker; if the patch is a result of some -earlier mailing list discussion or something documented on the web, point to -it. +can be found on the web, add 'Link:' tags pointing to it. If the patch is a +result of some earlier mailing list discussions or something documented on the +web, point to it. When linking to mailing list archives, preferably use the lore.kernel.org message archiver service. To create the link URL, use the contents of the @@ -134,6 +132,16 @@ resources. In addition to giving a URL to a mailing list archive or bug, summarize the relevant points of the discussion that led to the patch as submitted. +In case your patch fixes a bug, use the 'Closes:' tag with a URL referencing +the report in the mailing list archives or a public bug tracker. For example:: + + Closes: https://example.com/issues/1234 + +Some bug trackers have the ability to close issues automatically when a +commit with such a tag is applied. Some bots monitoring mailing lists can +also track such tags and take certain actions. Private bug trackers and +invalid URLs are forbidden. + If your patch fixes a bug in a specific commit, e.g. you found an issue using ``git bisect``, please use the 'Fixes:' tag with the first 12 characters of the SHA-1 ID, and the one line summary. Do not split the tag across multiple @@ -498,9 +506,11 @@ Using Reported-by:, Tested-by:, Reviewed-by:, Suggested-by: and Fixes: The Reported-by tag gives credit to people who find bugs and report them and it hopefully inspires them to help us again in the future. The tag is intended for bugs; please do not use it to credit feature requests. The tag should be -followed by a Link: tag pointing to the report, unless the report is not -available on the web. Please note that if the bug was reported in private, then -ask for permission first before using the Reported-by tag. +followed by a Closes: tag pointing to the report, unless the report is not +available on the web. The Link: tag can be used instead of Closes: if the patch +fixes a part of the issue(s) being reported. Please note that if the bug was +reported in private, then ask for permission first before using the Reported-by +tag. A Tested-by: tag indicates that the patch has been successfully tested (in some environment) by the person named. This tag informs maintainers that From patchwork Mon Apr 3 16:23:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 78630 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2428318vqo; Mon, 3 Apr 2023 09:26:50 -0700 (PDT) X-Google-Smtp-Source: AK7set+aMt6hkPgX3nWAZUb5q8Mg0D7SwMPrJ+vD6whIJDgrZL0JKAVuLYrc6a3J0m1S18tVLwTd X-Received: by 2002:a05:6a20:7b29:b0:dc:a14e:d9bf with SMTP id s41-20020a056a207b2900b000dca14ed9bfmr27430274pzh.43.1680539210104; Mon, 03 Apr 2023 09:26:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680539210; cv=none; d=google.com; s=arc-20160816; b=ifmW6AjD7fIjbVJ4fSZeEVaXL47KWzk4MnT0AqtF/bLBDUMhzxgJTB7ZJCHffaJovx j2xJwOisWC3kr8cxMGRLaZW2ixPea6Gj1VixIVxJDt7DVpAYXEJmw+20/30Q3TUuD35m w5TcmWW5lwFpolRc5QEFW5I3uqtIKuz2dQO+OTRykLQrJu6BwKie+JJO2ZpU+GYmAsL5 9aw3yhSnIH5PFq2NWCy6BlR197VgfeP9pGY9Y2NWm6psELUEhyNddeHZXgXAJCsBRXi4 xsWdQAzVGtAUCkIPgVWySz3SEaalHH6cOmt0Ld733IAAf+y35NGnTxZfMi03PZiA0hGk UMBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=sLbSiNRsKWqCzdZcwUoUNgk3CV0rprb5ejaACgf2prg=; b=NxPJgLhtKAUNMv5ltGDWpK+V5Syus2Aob0PAb65EN3fn61jb39F0aNtLCKys3qAu/M j+imjmMcSiJlAibAlkE1hTwNqCFAWQ5l6WbBi8uaMGIvBVBx2PNkssSOxWfkRHX2yLeK kOdoZmpLYf41Uotd5/Kre/AUAb+LqHuYp2S8eiKyhLtmG0rM+OhNUIr367SfsdbQA8vw +f99kPJFb3ATaK0zvbalSLdIAoZ3gqOU6BrCcqKNh2DaS/jmL22nNC/D2yw6gMeUh5Kb IQnv8rzJnjoQyfxLnBt1uMBXgRmGzXm93RgYqHzsDcYd3LUKlKWJIh8CeVY3l6Qv54Ig 0ITg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=Mxhnw+xQ; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a63cc0a000000b0050fb3fdeecdsi8462889pgf.177.2023.04.03.09.26.38; Mon, 03 Apr 2023 09:26:50 -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=Mxhnw+xQ; 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 S232714AbjDCQX7 (ORCPT + 99 others); Mon, 3 Apr 2023 12:23:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232601AbjDCQXy (ORCPT ); Mon, 3 Apr 2023 12:23:54 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D7FA1FD3 for ; Mon, 3 Apr 2023 09:23:53 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id m6-20020a05600c3b0600b003ee6e324b19so18487439wms.1 for ; Mon, 03 Apr 2023 09:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1680539032; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sLbSiNRsKWqCzdZcwUoUNgk3CV0rprb5ejaACgf2prg=; b=Mxhnw+xQ6KKG6PnQsr/Vxp7w4V6qBj09vw1czow7R9Giy1wpvwYXExtlV7amfrcxrv RRQZwHNxWsvxoGXx2/G9c+lt8oRQj894cnFuvXlpriaofZXN6dS8tDHUTEWf8CjDGf8R nMD1MwuM6pexhAP+njybzWbfntGt/copvvOmQ1H6TDwx/fLG1xpzl9OIN/qCyXtgW6Ck WVyw/3frZU/DMFMUsTQ5n8zsphGBjRg8AOTs7e1j1CJwHigvV3OJ1xxkJuZT7N6JBQc2 Nz5hfVkycRmtElrX9w5Avs/21KmRcdhQ+pUzBNCEYq3rGePDggteBzTPfb6lrJvzLaRR rXbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680539032; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sLbSiNRsKWqCzdZcwUoUNgk3CV0rprb5ejaACgf2prg=; b=NDwaMGP5Fwo4/6MenZtzHHztXQYI4Amqzq/NhOJJclndN0uHeTfur/DMt2sScZD2uU k8u38SHI+HTPOBHs/1n/UsyMeRUdcaKnkKL3Z3pd+Fe7fglKbnHjZxPe80eJNufXWbY7 SLHhbb+X4zr4U5V9gs6uVGM6cQ9hhlVGzyHEe8q1JNNLkao2mlBzIdfwh9YTuYX5uXgI znGR3yahGfiM/8tzaOjwwbJro5SdMAxFTsXEe9101J7GdztzyXPO60C0yBAdpI7rn3cw Eg2g/hZXE4s9UKqorSkRUwq8aHgf+Xy8vD5pW9BSppouSPNeMI80/RRPWOawmJiZbjN0 iXpA== X-Gm-Message-State: AAQBX9c6dcdoWG8fJ637WP9CZ68Nys5Cm8xhf1WCMmMBUPE+7eFIWdhE glBEWaDoLjx/OpjnZ2jL7oaHpgGaN3UCFT3lttDEpA== X-Received: by 2002:a05:600c:b51:b0:3ed:2a91:3bc9 with SMTP id k17-20020a05600c0b5100b003ed2a913bc9mr71024wmr.15.1680539031787; Mon, 03 Apr 2023 09:23:51 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id s7-20020a05600c45c700b003ee2a0d49dbsm19829116wmo.25.2023.04.03.09.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 09:23:51 -0700 (PDT) From: Matthieu Baerts Date: Mon, 03 Apr 2023 18:23:47 +0200 Subject: [PATCH v4 2/5] checkpatch: don't print the next line if not defined MIME-Version: 1.0 Message-Id: <20230314-doc-checkpatch-closes-tag-v4-2-d26d1fa66f9f@tessares.net> References: <20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net> In-Reply-To: <20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net> To: Jonathan Corbet , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , =?utf-8?q?Kai_Wasserb=C3=A4ch?= , Thorsten Leemhuis , 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, Matthieu Baerts X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1457; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=K3cjNbV9tUlSWM4bnvbSgWdjh1Zoz6cfbrBe3P7xpF4=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkKv2UgvhwReqAHut5rSYlb6gkdkA+ymQEB79mc ux2STszGiOJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZCr9lAAKCRD2t4JPQmmg c9zpD/9Zn9Kd+V59Exp4MDR8um6ylr3dkGhOgdQbkW1v/XOZI2M44kiNB7XTXQ+nw10k0gxnzSv Cn3M5xWghoIK6rtlkEWOoqK3+fiYdgQIqNyV8CDYFtsyr0S/HaxPKClYLYNoC+HQ3dRu11EM3vl bxPSXjYIaVSK64AEaxkSpmLNN8MuTZhU6kVMAOyB3gv/jYSOr/2kNCE+WoTlOONTtpqlXp3sFnp sNHTSDZgFA5BjIy5on1kfOWK1N6C0RGjNgLC53/NOD/OYu9xLFtdgJZwAMUXL7267eUTJMk8oTQ u2LbVhoAmhJn6ZWw1ga1Imao93Hezg1AwwhbQ6nizbOEoZYP+383m9ErD02A7BGACCF8tniccqB lqeVV5gRgQzhRGCp9nGvmhKF+DRdIu95XoT1z0H8p1UjcOjCMdLrCfqJKU0vQ8riELAMSUZ8U0o CCPbw+bTL2nq2tWKoqer1z65lFhUa6boCqRPk7Z1E3XTqN/qg84GmgztTiF7Vkuipp0emNXwXcy 8hQv/pyCFdpaALFfHT0eDDROgyXhKT1QrsuLO9SpsErqdfM6wr8bYuIagVeGe1JlwJiE+me+Dwf 4Izt4nfeoDBFOOvdksRXPlsxWNbt5W4lZdFRx2kujwavImkrvxLnS1jOxUeEqzmwtevz01qNTj3 DqR+9hHRWNlTxpQ== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762173082576839248?= X-GMAIL-MSGID: =?utf-8?q?1762173082576839248?= When checking if "Reported-by" tag is followed by "Link:", there is no need to print the next line if there is no next line. While at it, also mention in this case that the "Link:" tag should be followed by a URL, similar to the next warning. By doing that, the code is now similar to what is done above when checking if the Co-developed-by tag is properly used. Fixes: d7f1d71e5ef6 ("checkpatch: warn when Reported-by: is not followed by Link:") Signed-off-by: Matthieu Baerts --- v4: - Add new patch. --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index bd44d12965c9..b170fc7ef258 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3162,7 +3162,7 @@ sub process { if ($sign_off =~ /^reported(?:|-and-tested)-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"); + "Reported-by: should be immediately followed by Link: with a URL to the report\n" . $herecurr . "\n"); } elsif ($rawlines[$linenr] !~ m{^link:\s*https?://}i) { WARN("BAD_REPORTED_BY_LINK", "Reported-by: should be immediately followed by Link: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); From patchwork Mon Apr 3 16:23:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 78631 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2428533vqo; Mon, 3 Apr 2023 09:27:08 -0700 (PDT) X-Google-Smtp-Source: AK7set+32w6rzUyfsHnm9rmDMnk356oDm5bw843OwtrOQyKYBmqWYq83vwmCn1Q+ZQQz8Cko/yLq X-Received: by 2002:a05:6a20:19a:b0:cb:f5ab:3bd0 with SMTP id 26-20020a056a20019a00b000cbf5ab3bd0mr28484754pzy.59.1680539228113; Mon, 03 Apr 2023 09:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680539228; cv=none; d=google.com; s=arc-20160816; b=UNz+JMxCRJscymDd3CO2q1IBoh2sk80y9v6tr93nFS2duHsEMfmqDFYG08GV8mnDVQ 5rhtY1NX+bGD06memShm+XHNNDs1ajJBdqxWXq5+6EfgqNTnoE4E71nWhOCEFp78Adpu eZ/KiVrKPABingGgqbhB7HTJYb2cRWpM7VRD7H7+YiMOEbgatT3atDkskdrBPss6/6BG c7K1JdFPoiYzxeashjBG0PiEk4lmTERk21o08DTWb1HNk0FREfqrVBNoBG4HoFhaNdfJ evUXPqAQB3TFxvlTOXneBQjFDdfU02ZK8fPJ1d33Q5MmUH/8oArFPcesmNabTPfL6d2u 9n7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=O0VIT8TZ6PUqENiB0PP2YTFEcbQqLs8d7zTBwgh+XTk=; b=kfZhB0iuZM64O/IK/wplkuZ0Q1kZPkeS5+owMcLoN+w8+Rzk0A3AeMD6AW8KGd46TB ADhufd870LuiRXH9SmzbuSJA8pG1qnaHTZt7PwLjGmvT1dwH5lPbUcMunggB5aJsbdXY Js8nwvc2jr+uTE1rsis7WguorL20ZDTJBPKPiqKcgZtBqm/b2qiUJ0Bqy2la2CbUpS8f VF2OQk07kJP2FqWO+SGaqhuBb06cDJt/IAmygCbQX7/TwXqK9wn2xZWPyPT33GIDU90B u3l6BzR5EaJyb9basvO4mTOSdAPE7XopngsYp+u1pgSInhSB1LcRmpLEQEVXGgK8yvc3 zH9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=elnCELaS; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a632c07000000b0050bfb509db2si8445558pgs.633.2023.04.03.09.26.51; Mon, 03 Apr 2023 09:27:08 -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=elnCELaS; 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 S232764AbjDCQYH (ORCPT + 99 others); Mon, 3 Apr 2023 12:24:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232591AbjDCQX4 (ORCPT ); Mon, 3 Apr 2023 12:23:56 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86440171C for ; Mon, 3 Apr 2023 09:23:54 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id o32so17449196wms.1 for ; Mon, 03 Apr 2023 09:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1680539033; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=O0VIT8TZ6PUqENiB0PP2YTFEcbQqLs8d7zTBwgh+XTk=; b=elnCELaSFuXK7yQWz3Paf/eINw2dgDZyfnQT8ZKYrr8N1smCeAHdFhw96SJZVaILTH xUMUanNqKktx8pznls2/BHD+0l3h8ki/zHPel6WOVHeYFQptHYSin6ixIWQaHGiunnNA i94NNXizaMEYgqS7oYspnANoq1aNrw/lq+2WOuQ13Fx2vPbp38JADSkil14J/+LOplQD 5sTSs8yhQ++ItEt7iif0uWD7scYzgRQpSjoT2b3LUTndSzMVs8npKG4qt51nzgvDRCcu v8taopgWDKHutDCDkHvXfVwKVdwpTyJVeM3HeHHKAkMzglUWrhqKgByfmWpYqMK1x0ZN hBRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680539033; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O0VIT8TZ6PUqENiB0PP2YTFEcbQqLs8d7zTBwgh+XTk=; b=B4LxlgNtRm7WG1TTUNBmffDA/HJweLnLkaqoQ9ZuSF95k26cWjXent8pNDckF9edu1 QdhhtNABoFPEcuZm4EeH54HqJ8uKYGvvfA3u2r2a/D22WYHn8OCdZUCRL4LsenqoJzw7 DxZ1QR7i+Qu6vR0SDcUqS0ei9krbz35GMkPM7W5RRBFpoKHa4vXBbl/LIAoj5vLqnDGl 005AwCtnqL7gc0Bw3ojKCAV31JAGUY2Q+rIFil+22Cl0KyrFWu/YRL8GZt/x4xV1si14 3lXmWvBJyGHpOMM4Ctx1vPuiiTNEZCErYajjuy7/hGbPoN570KL3gkTs/Pkz+JrdsQy7 a3Bw== X-Gm-Message-State: AAQBX9cidgR61IROyTjtNq9a5JmsSj37wqEpRpPmpAGlVnQ0BPR9mx0v 1VQjU4hmVBfKopXGpSx3Bf2uCQ== X-Received: by 2002:a1c:ed0d:0:b0:3f0:46ca:f204 with SMTP id l13-20020a1ced0d000000b003f046caf204mr91834wmh.3.1680539032898; Mon, 03 Apr 2023 09:23:52 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id s7-20020a05600c45c700b003ee2a0d49dbsm19829116wmo.25.2023.04.03.09.23.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 09:23:52 -0700 (PDT) From: Matthieu Baerts Date: Mon, 03 Apr 2023 18:23:48 +0200 Subject: [PATCH v4 3/5] checkpatch: use a list of "link" tags MIME-Version: 1.0 Message-Id: <20230314-doc-checkpatch-closes-tag-v4-3-d26d1fa66f9f@tessares.net> References: <20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net> In-Reply-To: <20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net> To: Jonathan Corbet , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , =?utf-8?q?Kai_Wasserb=C3=A4ch?= , Thorsten Leemhuis , 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, Matthieu Baerts X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2709; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=uNHgQP9fiZeAiaOLfX8aSeCRx0Lpr6GESKEpWun+wb4=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkKv2UTb48iAU3x83x6niNom53FDOQfO9/KSjdL HaiCNpConqJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZCr9lAAKCRD2t4JPQmmg cx74D/9dKhJje+7gSQaGaYypiZ60D9kMH014UKirg6BHlhT2CjZQjDYDnfBaIXZtLfLwGLCFgF7 lP0s3YVGqgJX4ww7TfJigC1mqHvk+E73LZrqo6Uav17ljzLBdP1L3K2i6VZep8f5gw0sQL3puPz QkaZCuJXvoiIFtfLX0rSQ8PFyKJXIlACQHWfrPpkiRztb+kx2X6sPC50XfDd4QPnOK0thxOKhAa qzC9mrpRE5ToYutQm5zpAF+ED2pOEcWkMXrRoiFRLCasU+V4LKLPa7KA/KELd3Mj+e3nGD6hIS0 qm/OdPNd3lawhGRH+D0RdDplpXqO4U0WOTp2pa56nHBe0Wcv9UwqWQYWheDKTw5gv91XbOWcoDz ABVDKCFyFXtHxIN6xAIMVEQswrCrPHS9aQ4fwPKwGDsLAFf1gJmOVcl2xhpI/1e/tKCdvl08l1b LiOtEFujaIlO2zOK0BGkA1rti4p5rzIKWcP1i/oM2kch/7kYaxCaj4X1uzXbA0rwGFSsRPNxJXZ Ki/WKJtWiSA4S6bc5KM8EwSjm/ryR96JerwIRLw+q/2gGll7glogis7JmvHy3EeYloyfnXIZ+r6 kPdAPECcIY2NTmVGk4yvSiSZIBx6zEzuAGvE/pzRNYzQfdyudKgmo3jwB7Zrm7WUWxrH2KfZLOO IGaz17ksBRJrY+A== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762173101219893760?= X-GMAIL-MSGID: =?utf-8?q?1762173101219893760?= The following commit will allow the use of a similar "link" tag. Because there is a possibility that other similar tags will be added in the future and to reduce the number of places where the code will be modified to allow this new tag, a list with all these "link" tags is now used. Two variables are created from it: one to search for such tags and one to print all tags in a warning message. Suggested-by: Joe Perches Signed-off-by: Matthieu Baerts --- v4: - "Reported-by:" should be followed by a "Closes:" tag. (Thorsten Leemhuis) v3: - new patch. (Joe Perches) --- scripts/checkpatch.pl | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b170fc7ef258..1647ef72480e 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -620,6 +620,22 @@ our $signature_tags = qr{(?xi: Cc: )}; +our @link_tags = qw(Link); + +#Create a search and print patterns for all these strings to be used directly below +our $link_tags_search = ""; +our $link_tags_print = ""; +foreach my $entry (@link_tags) { + if ($link_tags_search ne "") { + $link_tags_search .= '|'; + $link_tags_print .= ' or '; + } + $entry .= ':'; + $link_tags_search .= $entry; + $link_tags_print .= "'$entry'"; +} +$link_tags_search = "(?:${link_tags_search})"; + our $tracing_logging_tags = qr{(?xi: [=-]*> | <[=-]* | @@ -3250,8 +3266,8 @@ sub process { # file delta changes $line =~ /^\s*(?:[\w\.\-\+]*\/)++[\w\.\-\+]+:/ || # filename then : - $line =~ /^\s*(?:Fixes:|Link:|$signature_tags)/i || - # A Fixes: or Link: line or signature tag line + $line =~ /^\s*(?:Fixes:|$link_tags_search|$signature_tags)/i || + # A Fixes:, link or signature tag line $commit_log_possible_stack_dump)) { WARN("COMMIT_LOG_LONG_LINE", "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr); @@ -3266,13 +3282,13 @@ sub process { # Check for odd tags before a URI/URL if ($in_commit_log && - $line =~ /^\s*(\w+):\s*http/ && $1 ne 'Link') { + $line =~ /^\s*(\w+:)\s*http/ && $1 !~ /^$link_tags_search$/) { if ($1 =~ /^v(?:ersion)?\d+/i) { WARN("COMMIT_LOG_VERSIONING", "Patch version information should be after the --- line\n" . $herecurr); } else { WARN("COMMIT_LOG_USE_LINK", - "Unknown link reference '$1:', use 'Link:' instead\n" . $herecurr); + "Unknown link reference '$1', use $link_tags_print instead\n" . $herecurr); } } From patchwork Mon Apr 3 16:23:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 78632 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2428532vqo; Mon, 3 Apr 2023 09:27:08 -0700 (PDT) X-Google-Smtp-Source: AKy350bZJZ0u/ytDjHnDk1qlWDdUMIm32VzkuVN8C9nJfwcWWAnEZ2VYupn43s1rvC9zBFjstlvk X-Received: by 2002:a17:902:ec91:b0:1a1:dd3a:7509 with SMTP id x17-20020a170902ec9100b001a1dd3a7509mr43789475plg.48.1680539228107; Mon, 03 Apr 2023 09:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680539228; cv=none; d=google.com; s=arc-20160816; b=heRxQFwyQh3HOoT1s0nG+hEJ+IeHTV7INUhGMHTZXr6oeYNslQ+P801zJQ3wfeY/AE OclxBcZIPuPCaeax6GesOXL+rzHW5pMuvUlKQVIGwDR6QViJRCqbj9zaQ7iHramYow9C joX73sBqTxm+E9fFzYehrAv/gdXZ2P1gmgZ2yQjOSwY81rwCZNFH67e4M0wdhpF53XgJ QdDAwpiDHOBjh9mRoIyaOFczShrbmMEhAEyxDoHki/Od97+2VHa3+NKeFzbxNQX+y9dj sYG1p75qHptbn2oKSZhYGNO5IqkEKK6+Wzd2IzfnL/0KCmrioI9ndfPbke6NOV6Q+WCB B04A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=dFndR9/W7h5aU4Fe2XwyfApUNUusTQXxY5Oh96Y5H08=; b=GuOJANraFhNi0ijxjPLihbqXQ3DmkJs1Cz8cXa9EtiCOJfkb/RDrsS9TxSmQp1PtiG CGLdl3EUAolgNudxviA5ClLBl6R6dVwyhvMPNWenbhxE/JbVMVlzFfpLAv42ZIPcxMzB XwMQNloTXR+8/9ucfEEiHIYXRKoEtY+edZ4jdE3NY8uHkLWri+cUC0hLsFyJZJq6Y8NU mgSO8h5Aw5gz2CQB/sddVj0lRUHOfiN3Q0bb05xlWBZnlK0mk+02JvRjxOSaW27w5O0E 9kYsEVIRFuPaDWs9QMJCn1ovFdwW/So0ZVQDDn4pFUbgMlcL+cz4Qo2mKCd/LoiM9TKC 0LMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=CtTiSqSF; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kp7-20020a170903280700b0019f3c06fdfasi8068021plb.339.2023.04.03.09.26.55; Mon, 03 Apr 2023 09:27:08 -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=CtTiSqSF; 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 S232405AbjDCQYK (ORCPT + 99 others); Mon, 3 Apr 2023 12:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232675AbjDCQX5 (ORCPT ); Mon, 3 Apr 2023 12:23:57 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F49A1722 for ; Mon, 3 Apr 2023 09:23:55 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id v6-20020a05600c470600b003f034269c96so8238933wmo.4 for ; Mon, 03 Apr 2023 09:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1680539034; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dFndR9/W7h5aU4Fe2XwyfApUNUusTQXxY5Oh96Y5H08=; b=CtTiSqSFHAGl4ZEfSiggNEz/WxSjrXIU2rznjS7Pkq3KwaNVbsNHM12116ZNSm0hFx Ra5Yng5Pf/c9ha+QNvcrgPErs9g/2EY68USmA7SkakP0CCJwsrcpFU+Fd4YmzAmdNksY CMBH7q/02vbPZGRCQU3izxJb4dMo4IBQtu6xkUGKxnq92rVuiaPIlpJxvQc0gz2HEnSt axU/EdtXzAIQ+ooRKbpXiiiLdV7e/rtOzAed0oe0P5Zosb1IWLfjMyWlsvLC8Fh9MpAs cvD2jYvyxDosKBQY2qPFirKGk+7yK0e8TI74LzOwt4DvNvP2qcAyh4OrXMdwlrpDpdhB uGpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680539034; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dFndR9/W7h5aU4Fe2XwyfApUNUusTQXxY5Oh96Y5H08=; b=g0WS+8uCt3GJ6p7gVRCURxjlo4FH1d+HvU2oVzErNqenzi4CfhyoXYyqNUgMtAPoyJ HyolAOsnq7Ny9HdDr7mLWtPgBwKDpnfkltoZTjJPI4xnbkqFQbbzn7SD4k8vMMHAskWi yuljJdI/0Z+QZjlIvxtHCAb/ftAHqhk+B4tqp2dhg+lNtp3zXbTuLvkzNg5io4IiWQgM wnfBNpe8BvyZvp9YbHon9wKATgssBtgTBLIZXDSWdDnlgHVbUvdrczSO16AHQsSODtSW d0Wxc2vdcr/rpsj37HCoSo9chh7awJWX+VcFrjJE4GPr573YOR1o+eCVJ9vBCLzPP33d NkGw== X-Gm-Message-State: AAQBX9dd19th1wXSJgaVaSAg2HuIWclPGu/hnHT39R1CI5o1M2k+t8nW goPt7k+keDiwvg3LQPHjM5zSvA== X-Received: by 2002:a1c:790c:0:b0:3ee:7022:5eda with SMTP id l12-20020a1c790c000000b003ee70225edamr71884wme.7.1680539034050; Mon, 03 Apr 2023 09:23:54 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id s7-20020a05600c45c700b003ee2a0d49dbsm19829116wmo.25.2023.04.03.09.23.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 09:23:53 -0700 (PDT) From: Matthieu Baerts Date: Mon, 03 Apr 2023 18:23:49 +0200 Subject: [PATCH v4 4/5] checkpatch: allow Closes tags with links MIME-Version: 1.0 Message-Id: <20230314-doc-checkpatch-closes-tag-v4-4-d26d1fa66f9f@tessares.net> References: <20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net> In-Reply-To: <20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net> To: Jonathan Corbet , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , =?utf-8?q?Kai_Wasserb=C3=A4ch?= , Thorsten Leemhuis , 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, Matthieu Baerts X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2432; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=JWAyyZjGBbmZg+JymplXrtlAtGV5+g63c0hsDcABK3c=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkKv2U9pxJZQmA2qxcy8C6ndEKwxhMC5jKICAeo /KdeI4aYd6JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZCr9lAAKCRD2t4JPQmmg c8CWD/4t2tntee0dqHJBpYlhPe0YgSwRRQjNEmynoe5ThrSE27/qjs5NjmKUQPhnZxrZndhidOl k0nP42S/nkrKEVnBEeysL8rtoKop9SW2MClE884+4UscaXNjIJ5M6NY65vPmbK3mcuAsdlQma/q zNOeT7JAv5BodTJYOcqfqRpX119oXW3lYjYwkKIJX5/Vci6MsrAEv2uLJDMmr9J6Rn6SpALzjGM sL7N3cKglHqMjVeHvwtrCoapyiiz7t6QYT+sVGsjMFwIl2qirsZrSs/+MnvNrOdezw59rSRcAUw Ndm4rMaSfFupPQtUuKffG9OHDWHfXCZ9sCSBvIkTW8MEh0hsYO/6/mKsSKm7zT4UDqE4xxgNUMf PUO5rQRMDS9ykwJlzI++0l/WgVIWihGvtUHRMM8w3Hp0S18mIq8eFv1VGAGBOgvz6Yd/XmEImQy PvwcnjQNLn6a1jJMIdWwIDSpynueZZ6WxcBhaVjvhKfJSNKs7Qq8FpUkytWhZVBk4e16z8oaPBx q+Og7Gx+WFwkgJP9kuAvXXMH8lBbyfWJqxHsI7l2QoMYcj91UaALxIboZwiRsRsp99RfNWYzi1N 9j5OD3rVlM7AVQ1DS9Lw2MdcaS4QzG5DDctQDZFuP+voPXXkaaaKuxcIf+6/ve5D+da4b1UeIfI h2GMWTisn6HyVHQ== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762173101272787020?= X-GMAIL-MSGID: =?utf-8?q?1762173101272787020?= As a follow-up of a previous patch modifying the documentation to allow using the "Closes:" tag, checkpatch.pl is updated accordingly. checkpatch.pl now no longer complain when the "Closes:" tag is used by itself: commit 76f381bb77a0 ("checkpatch: warn when unknown tags are used for links") ... or after the "Reported-by:" tag: commit d7f1d71e5ef6 ("checkpatch: warn when Reported-by: is not followed by Link:") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/373 Signed-off-by: Matthieu Baerts --- v4: - remove the "Fixes" tags. (Joe Perches) - "Reported-by:" should be followed by a "Closes:" tag. (Thorsten Leemhuis) v3: - split into 2 patches: the previous one adds a list with all the "link" tags. This one only allows the "Closes" tag. (Joe Perches) - "Closes" is no longer printed between parenthesis. (Thorsten Leemhuis) --- scripts/checkpatch.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1647ef72480e..f8a57f400570 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -620,7 +620,7 @@ our $signature_tags = qr{(?xi: Cc: )}; -our @link_tags = qw(Link); +our @link_tags = qw(Link Closes); #Create a search and print patterns for all these strings to be used directly below our $link_tags_search = ""; @@ -3174,14 +3174,14 @@ sub process { } } -# check if Reported-by: is followed by a Link: +# check if Reported-by: is followed by a Closes: tag if ($sign_off =~ /^reported(?:|-and-tested)-by:$/i) { if (!defined $lines[$linenr]) { WARN("BAD_REPORTED_BY_LINK", - "Reported-by: should be immediately followed by Link: with a URL to the report\n" . $herecurr . "\n"); - } elsif ($rawlines[$linenr] !~ m{^link:\s*https?://}i) { + "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . "\n"); + } elsif ($rawlines[$linenr] !~ m{^closes:\s*https?://}i) { WARN("BAD_REPORTED_BY_LINK", - "Reported-by: should be immediately followed by Link: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); + "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); } } } From patchwork Mon Apr 3 16:23:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 78633 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2433463vqo; Mon, 3 Apr 2023 09:34:15 -0700 (PDT) X-Google-Smtp-Source: AKy350a3o6ziHF37YEPuL6W42KJ66zG+HWwoR6A6wCNOQ96YZHNZ2Gu78CKQ7/t6A493Y/Sz7T/5 X-Received: by 2002:a17:907:724b:b0:93f:2256:fc05 with SMTP id ds11-20020a170907724b00b0093f2256fc05mr37190631ejc.55.1680539655639; Mon, 03 Apr 2023 09:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680539655; cv=none; d=google.com; s=arc-20160816; b=Ovj1V3IlY0bvJ11fjz0kJ91Ylwy+u3KPreZ+S3FGi013TqK0nslyMeNauM9AchcCFu b4f9+PFUR7HMYcqeAcwVITn9K4NzprwpfsJWRudgOHrsCfRyj9TM9qx1JzOnNd3HY2Rm oT6GnUkfS5frItpoE3uNZrG7aGZFadqSrEfbErU2VW8ON5laeWfBb2S8aEhY6wzP0flv jgwUgn7f3T4hoXEaH1LsnzwKfbiuBssanC5zbr3L8Yyn582/VPienSpX/29K2K8x6zBn /7kt8iiOnEl7QaprZ/8gHfz23oY/nPd1pnvzguGz5nKzf3gDyz5EDRruifFHyeSDelRI DCiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=1cnPk/9AEptXAjDqAXnPNZVq3fipWv8RDKGe+Nooncw=; b=c4uW4dCG45onE36pcr1rn/AIP0LNUhHxDcSkvrgOJv9nIUwar1ZYq6WAxom2kHahzN lZsS3TpxBEt5xeRDK4UZwuY5ToRh7X1dNYEAp1ozPThSE7Si3ThLqVxZC8lhudcPUQSF d+NyGsG8bMseLMFrD03hBzq6JiWCsQQEXErfJxIHojqfq6EpM7+cNyEK903ZcLlNHZ/4 73p3kMnA83mGEVlbqYxUJOdTNkwp3fCgblDbJCkm06xCklxGBHiXhTNHpe31Wg6Z1IAS EJ7ZvbKcVZoDouEzGTtPegDHwqpxJ9YX1GrsFl+xmNzTCynyfddiOKeZBSK7sRixpIJ9 KyCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="bY/nVj3t"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me22-20020a170906aed600b0092fcba1b0f8si4471130ejb.821.2023.04.03.09.33.02; Mon, 03 Apr 2023 09:34:15 -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="bY/nVj3t"; 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 S232126AbjDCQYQ (ORCPT + 99 others); Mon, 3 Apr 2023 12:24:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232682AbjDCQX5 (ORCPT ); Mon, 3 Apr 2023 12:23:57 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC91F1FD3 for ; Mon, 3 Apr 2023 09:23:55 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id l37so17444729wms.2 for ; Mon, 03 Apr 2023 09:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1680539035; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1cnPk/9AEptXAjDqAXnPNZVq3fipWv8RDKGe+Nooncw=; b=bY/nVj3tvufRZC2aBKdYwGx6iARCUJjXkVNxp+oE/oG3ue8sZ0wK3wDYThVFVn/YZp 1BecYJHvgUHReHKT78+3DcLkwE17o2ziPNWrNsMiVyRpsvOShCyJr4n8wYITWFFsymyO CIPZtlWuUixZIILH8yY/D+rFwMuasQKHpesU1fJGSnk7BKUm73VcaZG3IHq+wRr+3fLe sAgJ3j5n9Ic7mDawcKIqSZxwxE35SSF/eTYKHVqrjfH69XtthMgO8jR9ZIrsDh0mQ2Mk +SfTl+AbAygGPD0TOKP6S8FZXmP5s4D2ErdIhqltjwG3HuESuD4JSYBGuWBMBEPHecpQ Aa0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680539035; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1cnPk/9AEptXAjDqAXnPNZVq3fipWv8RDKGe+Nooncw=; b=vhO0Sqy31os5tSMvXtlkZX+zc8zd3leiRuvHr0HeNB+ZW4aQxR/QMPeuvIdwD+p4+F 5Xn9h6HFrprcZ4NJ2Z03LhYF9Y4OqK1ITUH+DJpjuxLzpMWDnXxDNbhjbKN0ncbHjN/C SRi7v4CvewANiYxuNRgZWcpNzgqkriGt4F4sLR0KXclRetYNd9Cwz14CsM/Rhvjfbx/5 YiWzBpCOggsfgLn8Q9+QF6cP/a8357Kjj9xbnfbb6Ek70+DczVpi4mJNZJjrZBckHV2c hYuk4/y4ufWQiHPlKYCHTyEy9yXNaJWSbkFDujQ+cCoUHoX51Sf0O9kklyo5cUCe0qrR JzXQ== X-Gm-Message-State: AAQBX9cJlC6+2e6dzeS6X7oE3iAfACSraftDXrlbRg4CeugH546IwwDQ 8etFvAmD7eSFi68ZBTAFooiejg== X-Received: by 2002:a05:600c:2205:b0:3ed:fc8c:f197 with SMTP id z5-20020a05600c220500b003edfc8cf197mr27400wml.29.1680539035250; Mon, 03 Apr 2023 09:23:55 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id s7-20020a05600c45c700b003ee2a0d49dbsm19829116wmo.25.2023.04.03.09.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 09:23:54 -0700 (PDT) From: Matthieu Baerts Date: Mon, 03 Apr 2023 18:23:50 +0200 Subject: [PATCH v4 5/5] checkpatch: check for misuse of the link tags MIME-Version: 1.0 Message-Id: <20230314-doc-checkpatch-closes-tag-v4-5-d26d1fa66f9f@tessares.net> References: <20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net> In-Reply-To: <20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net> To: Jonathan Corbet , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , =?utf-8?q?Kai_Wasserb=C3=A4ch?= , Thorsten Leemhuis , 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, Matthieu Baerts X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2132; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=t+lMrvt0On4Mxp3JcNKwbfZAV8NHmHJODiLaTsQGeTo=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkKv2UP2J95HDGOy6GcObMoPKAxDPMjFQma0ptP YDEho8OsPWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZCr9lAAKCRD2t4JPQmmg cwtZD/wP797mT8e5Jwc0WcO3sS51zfy4ZGWVmeOkMdhMlXA+/JyEiFXu8ymEfqAPvI7mtMpnLyJ Jshl7CMySAjSk/aHtzfBkzG+TvNTgmHHOBgFgCe8VR2XzyaXCAXD5ydOXsn+wS7HdZYpnAL7Jk6 9RKRVTWhVt9qxEtNjsS+CNLkeen04AoWpIVc1o/gXxBhiHYQCWn4u6cJHFaZQsFfwKafTI+7FeB /4FoJrcDEw8JrcboiW43TiKfhvvnVqCdktlcbDl+lZvYH+DHi84N/bhSKl/RaTPqCRPvzqRT1W0 VeHq2BdEodmYC9QPVtMymqrT24MALuBAtCok3FMuTxl4lGbaN7Onfcq1MeIOeoIUMSNDLupcWj7 jgSsfeSeeSjLeni1lVKPTiWfaGsa291OmbyzocRa0AgsK9A7yoabDnCDuR9o9LxFLi5WvXMoItY DYyPYnap2vEOLeXcZosOQ+BqTLo40S9HvpddhyZNTe/1pIdUXdXzjHhuZ9BxU8qhpsZbFS68PhL J06bbGPyi82TSeV0ZSAxbQQJAW012371gfzb0jFystjLvFNuMdnNg+F+43UHeYoEO3sqLsu0C+z i9IZMhOPffkaLmYdH7F/HPtaJrwcyRRKQf2NpZXbbwf3t2TRBVtFEGIC1uiTfsIXqZLcFGRurI7 54xM8BrgjFZJcNA== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762173549761748874?= X-GMAIL-MSGID: =?utf-8?q?1762173549761748874?= "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: Now that we check the "link" tags are followed by a URL, we can relax the check linked to "Reported-by being followed by a link tag" to only verify if a "link" tag is present after the "Reported-by" one. Link: https://lore.kernel.org/linux-doc/CAHk-=wh0v1EeDV3v8TzK81nDC40=XuTdY2MCr0xy3m3FiBV3+Q@mail.gmail.com/ [1] Signed-off-by: Matthieu Baerts --- v4: - Relax "Reported-by being followed by a link tag" check - Check for "http(s)://" not just "http(s):" v3: - new patch addressing Linus' concerns. --- scripts/checkpatch.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f8a57f400570..6d602c61d72a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3179,7 +3179,7 @@ sub process { if (!defined $lines[$linenr]) { WARN("BAD_REPORTED_BY_LINK", "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . "\n"); - } elsif ($rawlines[$linenr] !~ m{^closes:\s*https?://}i) { + } elsif ($rawlines[$linenr] !~ /^closes:\s*/i) { WARN("BAD_REPORTED_BY_LINK", "Reported-by: should be immediately followed by Closes: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); } @@ -3292,6 +3292,17 @@ sub process { } } +# 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 !~ m{^https?://}) { + WARN("COMMIT_LOG_WRONG_LINK", + "'$tag' should be followed by a public http(s) link\n" . $herecurr); + } + } + # Check for lines starting with a # if ($in_commit_log && $line =~ /^#/) { if (WARN("COMMIT_COMMENT_SYMBOL",