Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

CI: Add markdown checker #1542

Merged
merged 1 commit into from
May 10, 2019

Conversation

jodh-intel
Copy link
Contributor

Add a simple tool that checks markdown files to ensure all links are valid.

Updated the static checker script to call this tool to ensure that documents with broken links are not merged.

Note that when the tool detects a broken link, it is often able to suggest the correct link name so looking at its output is beneficial.

Fixes #1485.

Signed-off-by: James O. D. Hunt james.o.hunt@intel.com

@jodh-intel jodh-intel requested a review from a team as a code owner May 8, 2019 09:10
@jodh-intel
Copy link
Contributor Author

/test

Copy link
Contributor

@grahamwhaley grahamwhaley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not going to admit to having read every line... :-)
For the overall intention and final results, lgtm.
Do we think it is possible to fire a Depends PR over on the docs repo to show this in action?

import (
"strings"

bf "gopkg.in/russross/blackfriday.v2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still suspect using the same markup tools that github itself uses to do the check might have made more sense:
https://github.com/github/markup
https://github.com/gjtorikian/commonmarker
https://github.com/github/cmark-gfm

The last one looks to be the core library, which is in C, so not too avant-garde or arduous maybe. c'est la vie.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point already taken but:

  • This tool was based on a test tool I had already half-written a while back.

    Although I think there is a lot more this tool could be made to do, I just want the checking integrated into the CI asap as we continue to see doc breakages and this tool will stop them (frankly, I'm surprised GitHub doesn't offer this sort of functionality already).

    Once we have "something" in the CI to perform the checks, we can always replace it with "something else" later.

  • markup is ruby and I'm very rusty on that.

  • the other 2 packages are written in C which -- although I love it -- is not a language we should probably be writing new code in.

  • writing it in go means the rest of the team will understand it (hopefully :-) but we can also leverage all the go goodness we rely on so much (go test, gofmt, etc).

Of course, if you or anyone else in the community would like to take up the gauntlet and rewrite this in ruby/rust/blah, be my guest - I won't be offended! 😄

@jodh-intel
Copy link
Contributor Author

/retest

@jodh-intel
Copy link
Contributor Author

/retest

Add a simple tool that checks markdown files to ensure all links are
valid.

Updated the static checker script to call this tool to ensure that
documents with broken links are not merged.

Note that when the tool detects a broken link, it is often able to
suggest the correct link name so looking at its output is beneficial.

Fixes kata-containers#1485.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
@jodh-intel
Copy link
Contributor Author

/retest

Copy link

@devimc devimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jodh-intel
Copy link
Contributor Author

@klynnrif - ptal at the new cmd/check-markdown/README.md.

@jodh-intel
Copy link
Contributor Author

The sooner we have "borked link protection" in the CI, the better for everyone imho. Hence, working on the assumption that "something is better than nothing", let's merge this and fix up any doc issues on a follow-up PR...

@jodh-intel jodh-intel merged commit 8cc569c into kata-containers:master May 10, 2019
@klynnrif
Copy link

@jodh-intel apologies, I missed this ping. Would you still like a review on this?

@jodh-intel
Copy link
Contributor Author

No problem - you can review if you wish and I'll raise a new PR. But I'm about to raise a follow-up PR which will have a few doc changes so you could wait for that if you want?

@klynnrif
Copy link

@jodh-intel I'll wait for the follow-up PR. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a markdown checker to the CI
4 participants