Repository navigation
Fix 30 broken documentation links, and check them from now on - #450
Merged
Merged
Conversation
Somebody who wanted to contribute read the docs, clicked through to the developer guide, and got a 404. They opened discussion #25 about it rather than simply leaving, which is more than anyone is owed. docs/GOVERNANCE.md linked to `docs/DEVELOPMENT.md` from inside docs/, so it resolved to docs/docs/DEVELOPMENT.md. The file had been there the whole time. Scanning for the same shape found 30 broken links across six files: .github/CODE_OF_CONDUCT.md, .github/SECURITY.md, docs/GOVERNANCE.md, docs/PRIVACY.md, docs/ROADMAP.md and docs/TERMS_OF_USE.md. Every single target existed and not one of the links reached it - so this is 30 repointed links and no new documents. Two mistakes, repeated: writing docs/X.md from inside docs/, and referring to SECURITY.md, CODE_OF_CONDUCT.md, LICENSE and THIRD-PARTY-NOTICES.md as though every file sat in the same directory. They survived because a relative link looks right in an editor, resolves in most previewers, and is only wrong on GitHub - which is where the reader is - and because nothing checked. The one link check that existed covered the README only, and resolved from the repository root rather than from the file, so it could not have caught any of these. tests/docs-links.test.js now resolves every relative link from the directory of the file it appears in, across every tracked markdown file. A second test names the docs/-inside-docs/ mistake specifically, so the failure explains itself instead of posing a puzzle. Both were mutation-checked.
17 tasks done
Contributor
|
Merged to Try it at https://develop.posnic.io, or run it yourself: git fetch origin develop && git checkout develop
npm install && npm --prefix api install
npm run dev # then http://localhost:3000When you have tested it, say what you did and what happened, and set Reporting that something is broken is as useful as fixing it. It is |
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.
Closes the report in discussion #25.
What was wrong
docs/GOVERNANCE.mdlinked todocs/DEVELOPMENT.md— from insidedocs/. So it resolved todocs/docs/DEVELOPMENT.mdand 404'd. The file was there the whole time.Scanning for the same shape found 30 broken links across six files:
docs/TERMS_OF_USE.mddocs/GOVERNANCE.mddocs/PRIVACY.md.github/SECURITY.mddocs/ROADMAP.md.github/CODE_OF_CONDUCT.mdEvery target existed. Not one of the links reached it. So this PR repoints 30 links and adds no new documents — 30 insertions, 30 deletions.
Two mistakes, repeated:
docs/X.mdfrom insidedocs/SECURITY.md,CODE_OF_CONDUCT.md,LICENSE,THIRD-PARTY-NOTICES.mdas if every file were in the same directoryWhy it survived
A relative link looks right in an editor, resolves in most previewers, and is wrong only on GitHub — which is where the reader is.
And nothing checked. The one link test that existed covered the README alone and resolved paths from the repository root rather than from the file, so it could not have caught a single one of these.
The check
tests/docs-links.test.jsresolves every relative link from the directory of the file it appears in — what GitHub actually does — across every tracked markdown file. A second test names thedocs/-inside-docs/mistake specifically, so the failure explains itself rather than posing a puzzle:Both mutation-checked: I reintroduced the original bug and confirmed they fail.
npm test— 1255 pass, 0 fail.