All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] docs & checkpatch: allow Closes tags with links
@ 2023-03-15 17:44 ` Matthieu Baerts
  0 siblings, 0 replies; 38+ messages in thread
From: Matthieu Baerts @ 2023-03-15 17:44 UTC (permalink / raw)
  To: Jonathan Corbet, Andy Whitcroft, Joe Perches, Dwaipayan Ray,
	Lukas Bulwahn, Kai Wasserbäch, Thorsten Leemhuis,
	Andrew Morton, David Airlie, Daniel Vetter
  Cc: linux-doc, linux-kernel, dri-devel, mptcp, Matthieu Baerts

Since v6.3, checkpatch.pl now complains about the use of "Closes:" tags
followed by a link [1]. It also complains if a "Reported-by:" tag is
followed by a "Closes:" one [2].

As detailed in the first patch, this "Closes:" tag is used for a bit of
time, mainly by DRM and MPTCP subsystems. It is used by some bug
trackers to automate the closure of issues when a patch is accepted.

Because this tag is used for a bit of time by different subsystems and
it looks like it makes sense and it is useful for them, I didn't bother
Linus to get his permission to continue using it. If you think this is
necessary to do that up front, please tell me and I will be happy to ask
for his agreement.

The first patch updates the documentation to explain what is this
"Closes:" tag and how/when to use it. The second patch modifies
checkpatch.pl to stop complaining about it.

The DRM maintainers and their mailing list have been added in Cc as they
are probably interested by these two patches as well.

[1] https://lore.kernel.org/all/3b036087d80b8c0e07a46a1dbaaf4ad0d018f8d5.1674217480.git.linux@leemhuis.info/
[2] https://lore.kernel.org/all/bb5dfd55ea2026303ab2296f4a6df3da7dd64006.1674217480.git.linux@leemhuis.info/

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
Matthieu Baerts (2):
      docs: process: allow Closes tags with links
      checkpatch: allow Closes tags with links

 Documentation/process/5.Posting.rst          |  9 +++++++++
 Documentation/process/submitting-patches.rst |  7 +++++++
 scripts/checkpatch.pl                        | 16 ++++++++--------
 3 files changed, 24 insertions(+), 8 deletions(-)
---
base-commit: 6015b1aca1a233379625385feb01dd014aca60b5
change-id: 20230314-doc-checkpatch-closes-tag-1731b57556b1

Best regards,
-- 
Matthieu Baerts <matthieu.baerts@tessares.net>


^ permalink raw reply	[flat|nested] 38+ messages in thread
* [PATCH v2 2/2] checkpatch: allow Closes tags with links
@ 2023-03-24 18:52 Matthieu Baerts
  2023-03-24 19:51 ` checkpatch: allow Closes tags with links: Tests Results MPTCP CI
                   ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Matthieu Baerts @ 2023-03-24 18:52 UTC (permalink / raw)
  To: Jonathan Corbet, Andy Whitcroft, Joe Perches, Dwaipayan Ray,
	Lukas Bulwahn, Kai Wasserbäch, Thorsten Leemhuis,
	Andrew Morton, David Airlie, Daniel Vetter, Konstantin Ryabitsev,
	Bagas Sanjaya, Linus Torvalds
  Cc: linux-doc, linux-kernel, dri-devel, mptcp, Matthieu Baerts

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) {
 					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);
 			}
 		}
 

-- 
2.39.2


^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2023-03-25  7:27 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 17:44 [PATCH 0/2] docs & checkpatch: allow Closes tags with links Matthieu Baerts
2023-03-15 17:44 ` Matthieu Baerts
2023-03-15 17:44 ` [PATCH 1/2] docs: process: " Matthieu Baerts
2023-03-15 17:44   ` Matthieu Baerts
2023-03-15 18:12   ` Konstantin Ryabitsev
2023-03-15 18:12     ` Konstantin Ryabitsev
2023-03-15 18:29     ` Matthieu Baerts
2023-03-15 18:29       ` Matthieu Baerts
2023-03-15 18:19   ` Jonathan Corbet
2023-03-15 18:19     ` Jonathan Corbet
2023-03-15 18:28     ` Matthieu Baerts
2023-03-15 18:28       ` Matthieu Baerts
2023-03-15 19:12   ` Andrew Morton
2023-03-15 19:12     ` Andrew Morton
2023-03-17  8:00   ` Bagas Sanjaya
2023-03-17  8:00     ` Bagas Sanjaya
2023-03-20  9:07     ` Matthieu Baerts
2023-03-20  9:07       ` Matthieu Baerts
2023-03-15 17:44 ` [PATCH 2/2] checkpatch: " Matthieu Baerts
2023-03-15 17:44   ` Matthieu Baerts
2023-03-15 19:25   ` checkpatch: allow Closes tags with links: Tests Results MPTCP CI
2023-03-16  9:22 ` [PATCH 0/2] docs & checkpatch: allow Closes tags with links Thorsten Leemhuis
2023-03-16  9:22   ` Thorsten Leemhuis
2023-03-16 11:43   ` Matthieu Baerts
2023-03-16 11:43     ` Matthieu Baerts
2023-03-16 17:30     ` Linus Torvalds
2023-03-16 17:30       ` Linus Torvalds
2023-03-17 16:58       ` Daniel Vetter
2023-03-17 16:58         ` Daniel Vetter
2023-03-17 18:41         ` Matthieu Baerts
2023-03-17 18:41           ` Matthieu Baerts
2023-03-17 18:56           ` Konstantin Ryabitsev
2023-03-17 18:56             ` Konstantin Ryabitsev
2023-03-16 16:22   ` Konstantin Ryabitsev
2023-03-16 16:22     ` Konstantin Ryabitsev
2023-03-24 18:52 [PATCH v2 2/2] " Matthieu Baerts
2023-03-24 19:51 ` checkpatch: allow Closes tags with links: Tests Results MPTCP CI
2023-03-25  5:18 ` MPTCP CI
2023-03-25  7:27 ` MPTCP CI

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.