Meta: Fix Markdown linting

The new help://man links were linted incorrectly, and they're now
skipped by the markdown linter, such as in the pre-commit hook
This commit is contained in:
kleines Filmröllchen 2022-01-12 12:40:36 +01:00 committed by Linus Groh
parent 9592ba3548
commit 9ec2b379a4
Notes: sideshowbarker 2024-07-17 21:07:04 +09:00

View File

@ -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>
@ -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",
@ -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://")) {
// 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://")) {
// TODO: Resolve relative to $SERENITY_SOURCE_DIR/Base/
// Currently, this affects only one link, so it's not worth the effort.