-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write test for bad pattern: .md/#
#23329
Comments
I think we can use a simple jest test to find files with those wrong links and fails if one is found. |
That sounds good to me! 😄 |
.md/#
.md/#
I'd suggest using pre-commit hook - |
MkDocs One problem remains, the MkDocs build step runs at the end, not at the beginning. Here's what I mean:
We probably still want some kind of check to find the bad links when I'm writing them... 🙈 Footnotes |
Pinging @PeterNitsche so they see the new comments in this issue. |
pre-commit can catch mistakes when one tries to commit (before the code changes pushed to github). @HonkingGoose Would that cover your ask? |
I sometimes "cheat" by using the GitHub code editor online, instead waiting for a fresh Codespace to start. So using a |
The same pre-commit process can also invoked in CI. See this example: https://github.com/devopsloft/devopsloft.github.io/blob/main/.github/workflows/pre_commit.yml |
pre-commit hooks where removed recently because of slowness, so they aren't an option again |
Funny, the issue remains untouched for 2 weeks with a proposed solution and once the proposal is implemented, other proposals are discussed. 😄 Regarding the discussion: I like the pragmatic solution of using Jest to validate the documentation. It fits into the code concept since there are already other Jest tests validating the documentation. |
I'm happy with fixing just my bad links in the first iteration. 🙂 I'm only mentioning the mkdocs update because it might affect how/if the maintainers want to fix this issue. 🙂 And when I wrote the issue, the mkdocs update wasn't out yet... 😇 |
I assume this comment is directed at me. I thank you for the feedback. It is completely valid. |
@lmilbaum That comment was not meant as direct feedback at all. I am just highlighting the coincidental series of events which amuses me. 🙂 |
Describe the proposed change(s).
Write or adjust a GitHub Action test, that fails if it finds the
.md/#
pattern in any of our.md
files.Optional: the Action writes an annotation to the bad file. Like this:
Describe why we need/want these change(s).
I'm writing bad links each time, where I use the
.md/#
pattern to link to another file. I'd like a test that stops me doing this stupid thing. 😄This is because the VSCode preview accepts the bad pattern, but our published docs get messed up. 🙈
The text was updated successfully, but these errors were encountered: