-
Notifications
You must be signed in to change notification settings - Fork 3
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
Lint markdown files for broken links. #497
Conversation
(Not actually ready for review. Am trying to trigger CI pipeline to test that.) |
8ee542a
to
a4f6b47
Compare
bf0c069
to
05f45dd
Compare
05f45dd
to
7576c91
Compare
Ready now! All checks are passing and docs fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! Thanks
Makefile
Outdated
infra-lint: infra-lint-markdown infra-lint-scripts infra-lint-terraform infra-lint-workflows ## Lint infra code | ||
|
||
infra-lint-markdown: ## Lint Markdown docs for broken links | ||
BASEURL=`pwd`; find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check --config .github/workflows/markdownlint-config.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish it was possible to add comments in Makefiles since I would have loved to have a comment explaining this line for shell noobs like myself.
Optional suggestion: Maybe move this line to ./bin/lint-markdown.sh
where we can add comments and explain what it's doing so if anyone needs to update it they are better equipped
BASEURL=`pwd`; find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check --config .github/workflows/markdownlint-config.json | |
./bin/lint-markdown.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion! It'll also make it easier to add other markdown lints later if we want. In the process of this change, I discovered BASEURL
isn't as necessary as I thought. Must default to current working dir or something. Anyways, feel free to take another look and let me know if you have anything thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to approve!
20089a6
to
38173dc
Compare
This is awesome |
Ticket
Resolves #490
Changes
make
target for markdown files. Add a linter that checks for broken links.Context for reviewers
PLEASE: double check the fixed links to ensure I found the right one. 🙂
This linter only checks broken links. There are other markdown linters we can consider adding should the need arise. This linter will be run when running the specific make command
make infra-lint-markdown
as well as the general lint commandmake infra-lint
. Therefore, it will also be picked up as part of the CI pipeline which runs all the linters.For the action, I largely copied the action used in GoogleChrome.
Testing
Before
Running locally before fixing the errors (snippet image)
And see the CI failing for just this new check before fixing the errors it finds:
Snippet of failing checks
After
Locally,
make
command completes without error when finding no issues.All the beautiful checks in the CI for PRs pass! (Love those green checkmarks!)