Skip to content

adds git pre-commit hook which checks links & fixes broken links - #256

Open
DougReeder wants to merge 2 commits into
Hubs-Foundation:masterfrom
DougReeder:pre-commit-lint
Open

adds git pre-commit hook which checks links & fixes broken links#256
DougReeder wants to merge 2 commits into
Hubs-Foundation:masterfrom
DougReeder:pre-commit-lint

Conversation

@DougReeder

@DougReeder DougReeder commented Feb 9, 2026

Copy link
Copy Markdown
Member

What?

Adds git pre-commit hook which checks links, fixes broken links & replaces others with empty fragment

Why?

  1. To restore the user experience
  2. To catch broken links early, when they take little effort to fix.
  3. To make clear what links still need work
  4. Preparation for Documentation: standardize internal link formatting (relative vs absolute) #254

Examples

...Hubs uses glTF standards it supports many of the map types associated with physically-based materials.

How to test

  1. Change directory to website, run npm ci
  2. Create and switch to a throwaway branch
  3. Add a link to a URL which doesn't exist
  4. Run git add foo.md
  5. Run git commit, observe that commit is blocked
  6. Change the link to a URL which does exist
  7. Run git add foo.md
  8. Run git commit, observe that the commit is allowed

Documentation of functionality

The Git pre-commit hook is installed just before the NPM start script is run, as it would be in normal development.

In the rare case where this commit check should be bypassed, the -n flag can be passed to git commit

Limitations

Doesn't fix links that didn't have an obvious correction.

Doesn't have functionality to flag links which aren't standardized

Alternatives considered

There doesn't appear to be a Markdown linter that also checks links for reachability.

Open questions

Do we want a Markdown linter as well?

Additional details or related context

Valid paths which don't have a file of the same name, such as spoke-optimization.html, should be added to ignorePatterns in mlc-config.json

Why: to catch broken links early, when they take little effort to fix.
Why:
1. To restore the user experience
2. To make clear what links still need work
@DougReeder
DougReeder requested a review from Exairnous February 9, 2026 19:09
@DougReeder DougReeder added the dependencies Pull requests that update a dependency file label Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant