From 5c62ec769b7ba251f1a55e4b1ebbd521312a5012 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 26 Jun 2026 15:31:18 +1000 Subject: [PATCH 1/2] [linkcheck] Clear residual false positives in weekly lychee report The weekly link checker (#933) flags 8 errors out of ~25k links, all false positives or harmless artifacts on non-content pages: - IEEE Xplore returns "202 Accepted" (anti-bot) for a valid DOI cited in zreferences.html -> add 202 to --accept. - genindex / search / prf-prf are auto-generated utility pages with no source notebook, so the theme's "Download Notebook" button points at a nonexistent _notebooks/.ipynb and renders a second href="None" -> --exclude-path those three pages. - A Journal of Derivatives DOI redirects into a login/paywall loop that exceeds max-redirects; the citation itself is valid -> --exclude it. Configuration is kept inline in the workflow args (rather than a lychee.toml) because lychee runs against the gh-pages checkout, which does not contain repo-root config files. Closes #933 Co-Authored-By: Claude Opus 4.8 --- .github/workflows/linkcheck.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 1c9afee00..567bb58d9 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -24,7 +24,31 @@ jobs: # --root-dir resolves root-relative links (e.g. /_notebooks/*.ipynb, # /_pdf/quantecon-python.pdf) against the gh-pages checkout so they are # not reported as errors. See QuantEcon/lecture-python.myst#906. - args: --root-dir ${{ github.workspace }} --accept 200,403,503 *.html + # + # The flags below clear the residual false positives reported in + # QuantEcon/lecture-python.myst#933. Configuration is kept inline (rather + # than a lychee.toml) because lychee runs against the gh-pages checkout, + # which does not contain repo-root config files. + # --accept 202 IEEE Xplore returns "202 Accepted" (anti-bot) for + # valid links, e.g. doi.org/10.1109/TAC.1977.1101561 + # --exclude-path ... genindex / search / prf-prf are auto-generated + # utility pages with no source notebook, so the + # theme's "Download Notebook" button points at a + # nonexistent _notebooks/.ipynb (and renders a + # second button with href="None"). They carry no + # unique content links, so skipping them loses no + # coverage. + # --exclude Journal of Derivatives DOI redirects into a + # login/paywall loop (exceeds max-redirects); the + # citation itself is valid. + args: >- + --root-dir ${{ github.workspace }} + --accept 200,202,403,503 + --exclude-path genindex.html + --exclude-path search.html + --exclude-path prf-prf.html + --exclude '10\.3905/jod\.2012\.20\.1\.038' + *.html - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 uses: peter-evans/create-issue-from-file@v6 From e43871b903e52d6f42f5cff72acbcf043e2a5bd4 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 26 Jun 2026 16:08:28 +1000 Subject: [PATCH 2/2] [linkcheck] Escape and anchor --exclude-path regexes lychee treats --exclude-path values as regular expressions, so the unescaped dots in genindex.html / search.html / prf-prf.html were regex wildcards and the patterns were unanchored. Escape the dot and anchor the end ('\.html$') so each matches only the intended generated page. Addresses Copilot review feedback on #934. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/linkcheck.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 567bb58d9..6e447db95 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -44,9 +44,9 @@ jobs: args: >- --root-dir ${{ github.workspace }} --accept 200,202,403,503 - --exclude-path genindex.html - --exclude-path search.html - --exclude-path prf-prf.html + --exclude-path 'genindex\.html$' + --exclude-path 'search\.html$' + --exclude-path 'prf-prf\.html$' --exclude '10\.3905/jod\.2012\.20\.1\.038' *.html - name: Create Issue From File