Skip to content

Commit d6fe9ff

Browse files
BiscuitBobbyintel-lab-lkp
authored andcommitted
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> Suggested-by: Miguel Ojeda <[email protected]> Link: Rust-for-Linux#1104 Signed-off-by: Siddharth Menon <[email protected]>
1 parent 928f79a commit d6fe9ff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/checkpatch.pl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,10 @@ sub find_standard_signature {
735735
\Qspinics.net\E
736736
)};
737737

738+
our $zulip_forums = qr{(?xi:
739+
\Qrust-for-linux.zulipchat.com\E
740+
)};
741+
738742
our @typeListMisordered = (
739743
qr{char\s+(?:un)?signed},
740744
qr{int\s+(?:(?:un)?signed\s+)?short\s},
@@ -3415,6 +3419,12 @@ sub process {
34153419
"Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr);
34163420
}
34173421

3422+
# Check for permanent Zulip URL
3423+
if ($rawline =~ m{http.*\b$zulip_forums(?!(?:/#narrow/stream/.+/topic/.+/(?:near|with)/\d+)?($|\s+.*))}) {
3424+
WARN("PREFER_PERMANENT_URL",
3425+
"Use permanent Zulip links when possible - see https://zulip.com/help/link-to-a-message-or-conversation#get-a-link-to-a-specific-message\n" . $herecurr);
3426+
}
3427+
34183428
# Check for added, moved or deleted files
34193429
if (!$reported_maintainer_file && !$in_commit_log &&
34203430
($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||

0 commit comments

Comments
 (0)