Repository navigation
fix(links): report wrong letter case and names Windows cannot check out - #114
Merged
Merged
Conversation
On Windows and on macOS's default file system, both link checkers accepted destinations that are dead on GitHub, because lstat and exists() resolve names case-insensitively and quietly accept trailing dots, stream suffixes and device names. - The root-bounded walk compares every component with its directory listing (cached per scan) and reports a name whose letter case differs from the entry on disk, on every operating system. - A ':', a trailing dot or space, or a Windows device name (CON, PRN, AUX, NUL, COM0-9, LPT0-9, with or without an extension) is reported as a non-portable destination from its text, next to the existing backslash and drive-letter rules. Closes #103 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Reader problem and change
On Windows, and on macOS's default file system, both link checkers passed links that are dead on GitHub.
lstatandexists()resolve names case-insensitively and quietly accept trailing dots, stream suffixes and device names. A maintainer running the checks locally, in the Action on a Windows runner, or through the agent plugin got a green result for a link readers can't follow.letter case differs from the name on disk (GitHub is case-sensitive)on every operating system.:, a trailing dot or space, or a Windows device name (CON,PRN,AUX,NUL,COM0-9,LPT0-9, with or without an extension) is reported as a non-portable destination from its text. This joins the existing backslash and drive-letter rules.tools/README.mdand the changelog describe the rules.Closes #103
Evidence
The new
tests/test_portable_destinations.pyfails 13 times against the old tools on Windows. The cases:docs/guide.md,DOCS/Guide.md,Docs/guide.MDanddocs/GUIDE.md#setup, where the file isdocs/Guide.md;docs/Guide.md.,docs/Guide.md%20anddocs/Guide.md::$DATA;a%3Ab.md,NUL,con.md,docs/COM1.txtandlpt9.With the fix it passes. Names close to reserved ones (
console.md,nullable.md,COM10.md,docs.v2) still pass. BeautifulRepo itself has no wrong-case links: 194 Markdown and 205 HTML destinations are unchanged.Verification
Limitations
🤖 Generated with Claude Code