Skip to content

Check links in the files being committed, not the whole bundle - #34

Merged
ftschindler merged 2 commits into
mainfrom
adopt-linkspector-pre-commit
Oct 15, 2026
Merged

ftschindler merged 2 commits into
mainfrom
adopt-linkspector-pre-commit

Conversation

@ftschindler

Copy link
Copy Markdown
Owner

The link check moves to ftschindler/linkspector-pre-commit, which wraps linkspector so it reads the file list pre-commit hands it.

Two things follow from that, and the second is why this was worth extracting rather than fixing in place.

A commit is checked on what it touched. The old hook set pass_filenames: false and swept the whole bundle, so an unrelated link that went flaky somewhere else blocked a commit that had nothing to do with it. CI still runs prek with --all-files, which hands the hook every markdown file, so the full sweep is unchanged and nothing stops being checked.

One rev replaces two additional_dependencies. The linkspector and puppeteer pair is pinned in that repository and checked there against the Chrome it resolves, so the pairing is maintained in one place instead of being restated in every config that wants a link check. The long comment explaining which Chrome a puppeteer release downloads goes with it.

The second commit freezes the hook at its tag's commit, db683f2 for v0.1.0. Every other repo in this config carries a SHA with the tag in a frozen: comment, which is what autoupdate --freeze writes; a bare tag would have made the hook that rewrites every commit's link check the one thing here able to change without this file changing.

Verified by running prek run linkspector-changed against two files in the bundle: passes, and resolves links.

The hook moves to ftschindler/linkspector-pre-commit, which wraps linkspector
so it reads the file list pre-commit passes. One rev replaces the two
additional_dependencies, because the linkspector and puppeteer pair is pinned
in that repository and checked there against the Chrome it resolves.

CI still runs prek with --all-files, which hands the hook every markdown file,
so the full sweep is unchanged and an unrelated flaky link stops blocking a
commit that touched neither.
Every other repo in this config is pinned to a SHA with the tag in a
`frozen:` comment, which is what `autoupdate --freeze` writes. A bare tag
is mutable, so the one hook that rewrites every commit's link check was
the one thing here that could change without this file changing.
@ftschindler
ftschindler merged commit 01a958d into main Oct 15, 2026
3 checks passed
@ftschindler
ftschindler deleted the adopt-linkspector-pre-commit branch October 15, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant