mirror of
https://seed.radicle.dev/rad:z3trNYnLWS11cJWC6BbxDs5niGo82.git
synced 2026-10-18 19:10:39 +08:00
flake: Use lychee for link checking
Introduce [lychee] link checking in the flake.nix checks. Since `nix flake check` is limited by sandboxing, it only checks for internal links. Running `lychee` from the directory will check external links. In the future, this can be done via git hooks. [lychee]: https://github.com/lycheeverse/lychee
This commit is contained in:
committed by
Lorenz Leutgeb
parent
e837178f5e
commit
99a2a29f0a
@@ -1,2 +1,4 @@
|
||||
node_modules/
|
||||
result
|
||||
.lycheecache
|
||||
.direnv/
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
buildInputs =
|
||||
(with pkgs; [
|
||||
asciidoctor
|
||||
pkgs.lychee
|
||||
nodejs
|
||||
shellcheck
|
||||
yq
|
||||
@@ -35,20 +36,35 @@
|
||||
];
|
||||
};
|
||||
|
||||
checks.grammar =
|
||||
pkgs.runCommand "grammar-check" {
|
||||
nativeBuildInputs =
|
||||
(with pkgs; [
|
||||
nearley
|
||||
nodejs
|
||||
yq
|
||||
])
|
||||
++ [
|
||||
nearley
|
||||
checks = {
|
||||
grammar =
|
||||
pkgs.runCommand "grammar-check" {
|
||||
nativeBuildInputs =
|
||||
(with pkgs; [
|
||||
nearley
|
||||
nodejs
|
||||
yq
|
||||
])
|
||||
++ [
|
||||
nearley
|
||||
];
|
||||
} ''
|
||||
${./0004-general-uri-scheme/data/test/uri-scheme-tester.sh} ${./0004-general-uri-scheme/data}
|
||||
touch $out
|
||||
'';
|
||||
|
||||
links = pkgs.testers.lycheeLinkCheck {
|
||||
site = pkgs.lib.sources.sourceFilesBySuffices ./. [".md" ".adoc"];
|
||||
extraConfig = {
|
||||
extensions = ["md" "adoc"];
|
||||
include_fragments = true;
|
||||
exclude = [
|
||||
"^rad:.*$"
|
||||
"^web\\+rad:.*$"
|
||||
"^vscode:.*$"
|
||||
];
|
||||
} ''
|
||||
${./0004-general-uri-scheme/data/test/uri-scheme-tester.sh} ${./0004-general-uri-scheme/data}
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
extensions = ["md", "adoc"]
|
||||
include_fragments = true
|
||||
# Exclude custom URI schemes that lychee cannot resolve
|
||||
exclude = [
|
||||
'^rad:',
|
||||
'^web\+rad:',
|
||||
'^vscode:',
|
||||
]
|
||||
include_mail = false
|
||||
timeout = 20
|
||||
max_retries = 2
|
||||
retry_wait_time = 2
|
||||
Reference in New Issue
Block a user