mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Matthieu Baerts" <matthieu.baerts@tessares.net>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Andy Whitcroft" <apw@canonical.com>,
	"Dwaipayan Ray" <dwaipayanray1@gmail.com>,
	"Lukas Bulwahn" <lukas.bulwahn@gmail.com>,
	"Kai Wasserbäch" <kai@dev.carbon-project.org>,
	"Thorsten Leemhuis" <linux@leemhuis.info>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Konstantin Ryabitsev" <konstantin@linuxfoundation.org>,
	"Bagas Sanjaya" <bagasdotme@gmail.com>,
	"Linus Torvalds" <torvalds@linux-foundation.org>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, mptcp@lists.linux.dev
Subject: Re: [PATCH v2 2/2] checkpatch: allow Closes tags with links
Date: Fri, 24 Mar 2023 12:13:20 -0700	[thread overview]
Message-ID: <d24f2eca8f2a858b48ad0e019e58e0e5098be5c3.camel@perches.com> (raw)
In-Reply-To: <20230314-doc-checkpatch-closes-tag-v2-2-f4a417861f6d@tessares.net>

On Fri, 2023-03-24 at 19:52 +0100, Matthieu Baerts wrote:
> As a follow-up of the previous patch modifying the documentation to
> allow using the "Closes:" tag, checkpatch.pl is updated accordingly.
> 
> checkpatch.pl now mentions the "Closes:" tag between brackets to express
> the fact it should be used only if it makes sense.
> 
> While at it, checkpatch.pl will not complain if the "Closes" tag is used
> with a "long" line, similar to what is done with the "Link" tag.
> 
> Fixes: 76f381bb77a0 ("checkpatch: warn when unknown tags are used for links")
> Fixes: 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 <matthieu.baerts@tessares.net>
> ---
>  scripts/checkpatch.pl | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index bd44d12965c9..d6376e0b68cc 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3158,14 +3158,14 @@ sub process {
>  				}
>  			}
>  
> -# check if Reported-by: is followed by a Link:
> +# check if Reported-by: is followed by a Link: (or 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: to the report\n" . $herecurr . $rawlines[$linenr] . "\n");
> -				} elsif ($rawlines[$linenr] !~ m{^link:\s*https?://}i) {
> +					     "Reported-by: should be immediately followed by Link: (or Closes:) to the report\n" . $herecurr . $rawlines[$linenr] . "\n");
> +				} elsif ($rawlines[$linenr] !~ m{^(link|closes):\s*https?://}i) {

Please do not use an unnecessary capture group.

		(?:link|closes)

And because it's somewhat likely that _more_ of these keywords
could be added, perhaps use some array like deprecated_apis


>  					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 Link: (or Closes:) with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n");
>  				}
>  			}
>  		}
> @@ -3250,8 +3250,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:|Closes:|$signature_tags)/i ||
> +					# A Fixes:, Link:, Closes: 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 +3266,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 ne 'Link' && $1 ne 'Closes') {
>  			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:' (or 'Closes:') instead\n" . $herecurr);
>  			}
>  		}
>  
> 


  reply	other threads:[~2023-03-24 19:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 18:52 [PATCH v2 0/2] docs & " Matthieu Baerts
2023-03-24 18:52 ` [PATCH v2 1/2] docs: process: " Matthieu Baerts
2023-03-25  4:22   ` Bagas Sanjaya
2023-03-26 11:28   ` Thorsten Leemhuis
2023-03-27 13:05     ` Matthieu Baerts
2023-03-27 14:23       ` Thorsten Leemhuis
2023-03-27 15:30         ` Jonathan Corbet
2023-03-24 18:52 ` [PATCH v2 2/2] checkpatch: " Matthieu Baerts
2023-03-24 19:13   ` Joe Perches [this message]
2023-03-27 12:44     ` Matthieu Baerts
2023-03-25  6:25   ` Thorsten Leemhuis
2023-03-27 13:06     ` Matthieu Baerts
2023-03-27 14:28       ` Thorsten Leemhuis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d24f2eca8f2a858b48ad0e019e58e0e5098be5c3.camel@perches.com \
    --to=joe@perches.com \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=bagasdotme@gmail.com \
    --cc=corbet@lwn.net \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=dwaipayanray1@gmail.com \
    --cc=kai@dev.carbon-project.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@leemhuis.info \
    --cc=lukas.bulwahn@gmail.com \
    --cc=matthieu.baerts@tessares.net \
    --cc=mptcp@lists.linux.dev \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®