scripts/checkpatch.pl: check for non-permalinks to Zulip
Subsystems (2)
PATCH 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 a message links (which are permalinks).
If a non-permanent zulip link is referenced emit a warning and directs 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
@@ -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},
@@ -3415,6 +3419,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://chat.zulip.org/api/construct-narrow#narrows-that-use-ids\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.2
Joe Perches
maintainerQuoted 3 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 a message links (which are permalinks).
Why should these links be used in the kernel at all?
Quoted 6 lines · Joe Perches
Quoted 3 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 a message links (which are permalinks).
Why should these links be used in the kernel at all?
To my understanding, most of the discussion around the development of the Rust subsystem takes place here, and is frequently referenced in the mailing list.
Quoted 2 lines · Joe Perches
Why should these links be used in the kernel at all?
They should probably not be used in files, but we put them in commit messages from time to time, e.g. for Closes: or Link: tags.
Cheers,
Miguel
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 a message links (which are permalinks).
a message -> message
Quoted 2 lines
If a non-permanent zulip link is referenced emit a warning and directs to the zulip documentation.
emit -> , then emit
directs -> direct the user
zulip -> Zulip
Quoted 2 lines
permanent links are of the format:
https://.../#narrow/stream/x/topic/x/near/<numerical_id>
permanent -> Permanent
Quoted 2 lines
Reported-by [email protected]
Sorry, I copy-pasted a template we use for "good first issues" and I should have not mentioned these two tags, because it is not a bug. They should be Suggested-by and Link instead. Also, please use the standard format "Full Name <email>".
In addition, the link should be to #1104, not #110, i.e.
https://github.com/Rust-for-Linux/linux/issues/1104
Quoted 1 line
+ "Use permanent Zulip links when possible - see https://chat.zulip.org/api/construct-narrow#narrows-that-use-ids\n" . $herecurr);
Hmm... That link seems a bit too technical.
Perhaps it would be easiest to give an example here (like in the commit message) if there are no better docs about this.
Thanks!
Cheers,
Miguel