Skip to content

Commit

Permalink
Meta: Fix Markdown linting
Browse files Browse the repository at this point in the history
The new help:https://man links were linted incorrectly, and they're now
skipped by the markdown linter, such as in the pre-commit hook
  • Loading branch information
kleinesfilmroellchen authored and linusg committed Jan 12, 2022
1 parent 9592ba3 commit 9ec2b37
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions Userland/Utilities/markdown-check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <AK/HashTable.h>
#include <AK/LexicalPath.h>
#include <AK/OwnPtr.h>
#include <AK/RecursionDecision.h>
#include <AK/StdLibExtras.h>
#include <AK/Vector.h>
#include <LibCore/File.h>
Expand All @@ -25,18 +26,6 @@
static bool is_missing_file_acceptable(String const& filename)
{
const StringView acceptable_missing_files[] = {
// FIXME: Please write these manpages!
"/usr/share/man/man2/accept.md",
"/usr/share/man/man2/exec.md",
"/usr/share/man/man2/fcntl.md",
"/usr/share/man/man2/fork.md",
"/usr/share/man/man2/ioctl.md",
"/usr/share/man/man2/listen.md",
"/usr/share/man/man2/mmap.md",
"/usr/share/man/man2/mprotect.md",
"/usr/share/man/man2/open.md",
"/usr/share/man/man2/ptrace.md",
"/usr/share/man/man5/perfcore.md",
// These ones are okay:
"/home/anon/js-tests/test-common.js",
"/man1/index.html",
Expand Down Expand Up @@ -167,6 +156,11 @@ RecursionDecision MarkdownLinkage::visit(Markdown::Text::LinkNode const& link_no
outln("Not checking external link {}", href);
return RecursionDecision::Recurse;
}
if (href.starts_with("help:https://")) {
// TODO: Check that the man page actually exists. (That check would also fail because we are currently referring to some nonexistent man pages.)
outln("Not checking man page link {}", href);
return RecursionDecision::Recurse;
}
if (href.starts_with("file:https://")) {
// TODO: Resolve relative to $SERENITY_SOURCE_DIR/Base/
// Currently, this affects only one link, so it's not worth the effort.
Expand Down

0 comments on commit 9ec2b37

Please sign in to comment.