Repository navigation
Check links in the files being committed, not the whole bundle - #34
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: falseand 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 runsprekwith--all-files, which hands the hook every markdown file, so the full sweep is unchanged and nothing stops being checked.One
revreplaces twoadditional_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,
db683f2forv0.1.0. Every other repo in this config carries a SHA with the tag in afrozen:comment, which is whatautoupdate --freezewrites; 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-changedagainst two files in the bundle: passes, and resolves links.