Skip to contentSkip to conversation

scripts/checkpatch.pl: check for non-permalinks to Zulip

PATCH RESEND Superseded Siddharth Menon 2 participants 3 messages Dec 22, 2024

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 scripts/checkpatch.pl: check for non-permalinks to Zulip

Zulip links to https://rust-for-linux.zulipchat.com can break in case of renaming the topic or channel if they are not message links (which are permanent links).

If a non-permanent Zulip link is referenced then emit a warning and direct the user to the Zulip documentation.

Permanent links are of the format:
https://.../#narrow/stream/x/topic/x/near/<numerical_id>

---
 scripts/checkpatch.pl | 10 ++++++++++
 1 file changed, 10 insertions(+)
scripts/checkpatch.pl +10 -0
index 9eed3683ad76..9b15484b5a95 100755
@@ -735,6 +735,10 @@ our $obsolete_archives = qr{(?xi:
 	\Qspinics.net\E
 )};
 
+our $zulip_forums = qr{(?xi:
+	\Qrust-for-linux.zulipchat.com\E
+)};
+
 our @typeListMisordered = (
 	qr{char\s+(?:un)?signed},
 	qr{int\s+(?:(?:un)?signed\s+)?short\s},
@@ -3410,6 +3414,12 @@ sub process {
 			     "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
 		}
 
+# Check for permanent Zulip URL
+		if ($rawline =~ m{http.*\b$zulip_forums(?!(?:/#narrow/stream/.+/topic/.+/(?:near|with)/\d+)?($|\s+.*))}) {
+			WARN("PREFER_PERMANENT_URL",
+			     "Use permanent Zulip links when possible - see https://zulip.com/help/link-to-a-message-or-conversation\n" . $herecurr);
+		}
+
 # Check for added, moved or deleted files
 		if (!$reported_maintainer_file && !$in_commit_log &&
 		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
Signature · 1 line
2.39.5
#1 lore raw
Quoted 4 lines · Siddharth Menon

Zulip links to https://rust-for-linux.zulipchat.com can break in case of renaming the topic or channel if they are not message links (which are permanent links).

This is a resend of v2, but there was a v3 previously -- I would suggest clarifying which one is meant to be picked, so that this is easier to pick for maintainers.

Thanks!

Cheers,
Miguel

author
#2 lore raw
Quoted 4 lines · Miguel Ojeda

This is a resend of v2, but there was a v3 previously -- I would suggest clarifying which one is meant to be picked, so that this is easier to pick for maintainers.

I seem to have resent the wrong patch, I'm really sorry about that. I shall resend the correct patch soon.

Sincerely,
Siddharth Menon