Skip to content

Commit 4d0cadf

Browse files
committed
check-dead-links: ignore decompiler.com (certificate hasn't been renewed in time)
1 parent 596cea5 commit 4d0cadf

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

scripts/check-dead-links.fsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ open Markdig.Syntax.Inlines
1212
open Polly
1313
open Polly.Retry
1414

15+
let exclusionCodes = Map.ofArray [|
16+
"https://www.lkokemohr.de/fsharp_godot.html", HttpStatusCode.TooManyRequests // GitHub runner receives this often
17+
"https://www.reddit.com/r/fsharp/", HttpStatusCode.Forbidden
18+
|]
19+
20+
let ignoredLinks = Set.ofArray [|
21+
"https://www.decompiler.com/"
22+
|]
23+
1524
let rec visitRecursively (action: MarkdownObject -> unit) (node: MarkdownObject) =
1625
match node with
1726
| :? ContainerBlock as c ->
@@ -36,11 +45,6 @@ let collectLinks node =
3645
node
3746
urls
3847

39-
let exclusionCodes = Map.ofArray [|
40-
"https://www.lkokemohr.de/fsharp_godot.html", HttpStatusCode.TooManyRequests // GitHub runner receives this often
41-
"https://www.reddit.com/r/fsharp/", HttpStatusCode.Forbidden
42-
|]
43-
4448
let printLock = Object()
4549
let retryPipeline =
4650
ResiliencePipelineBuilder()
@@ -90,7 +94,10 @@ let readmeFilePath = Path.Combine(__SOURCE_DIRECTORY__, "../README.md")
9094

9195
let markdown = File.ReadAllText(readmeFilePath)
9296
let document = Markdown.Parse(markdown, trackTrivia = true)
93-
let links = collectLinks document |> Seq.filter isNonLocalLink
97+
let links =
98+
collectLinks document
99+
|> Seq.filter(fun x -> not(Set.contains x ignoredLinks))
100+
|> Seq.filter isNonLocalLink
94101

95102
let results = Async.RunSynchronously(async {
96103
use client = new HttpClient()

0 commit comments

Comments
 (0)