Feedback request: catching documentation files missing from a fresh Git clone #209422
Replies: 4 comments
|
Useful feature. I read Edge cases to test
Messages Manual vs. Actions |
|
Solid idea — the gap between "exists locally" and "exists in the commit" is exactly where doc links rot. On (1), the edge cases I would add to the test matrix:
The staged-file report you already have is genuinely rare in these checkers — most only compare worktree vs HEAD, not worktree vs index vs HEAD. — |
|
Hey, really like this idea. Broken README images are such a common problem. I went through Git LFS: if an image is tracked with LFS, your check passes because it's committed normally. But anyone who clones without LFS just gets a tiny pointer file, and the image breaks. Even Links with Files removed with One small suggestion for the messages: it'd help to tell people how to fix it, like: Nice work on the tests too. They're easy to follow. Happy to help write a test for any of these if you want. |
|
Hey, this is a brilliant tool! I completely agree with the others that --fresh-clone is best suited as a local pre-push or pre-commit hook rather than a GitHub Action. In CI, a fresh checkout already exposes missing files naturally, so running this locally saves developers that frustrating round-trip delay. Regarding edge cases, definitely prioritize case mismatches between macOS/Windows and Linux, and stripping URL parameters or fragments (like img.png?raw=true or file.md#setup). I'd also suggest handling relative path resolutions carefully, especially when the markdown file is deeply nested and referencing assets in a parent directory. For the output messages, extracting and appending the exact .gitignore rule or a quick fix command would be fantastic. Great work building this out! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
Body
Hi everyone,
I’m working on a small documentation checker called Markdown Local Check and would appreciate some feedback on a new feature.
The problem is simple: a README links to a screenshot or guide that exists on your computer, so the link looks fine. But the file is ignored or was never committed, and someone cloning the repository does not receive it.
The new
--fresh-cloneoption checks local documentation links against the latest Git commit. It reports ignored files, files that have not been committed, staged files, empty directories, and links outside the repository. Each report includes the Markdown filename and line number.For example:
Repository and instructions: https://github.com/Anubis371/markdown-local-check
Git checks: https://github.com/Anubis371/markdown-local-check/blob/main/src/git.js
Regression tests: https://github.com/Anubis371/markdown-local-check/blob/main/test/fresh-clone.test.js
It runs offline with Node.js and Git, without extra packages. There are 16 tests. It checks documentation file availability, not whether the application starts, and it does not verify that your local commit was pushed. Submodules and symbolic links need separate checks.
I’d particularly appreciate feedback on:
If you have time to try it, a small failing example or one concrete suggestion would help. Thanks for taking a look.
Guidelines
All reactions