Skip to content
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

Add GH action to lint markdown files #925

Merged
merged 1 commit into from
May 25, 2021
Merged

Conversation

kke
Copy link
Contributor

@kke kke commented May 24, 2021

Signed-off-by: Kimmo Lehto [email protected]

Adds a Markdown linter into github actions and fixes linting errors to make it pass.

  • Almost all of the markdown files contained trailing whitespaces on half of the lines, causing any doc PRs to contain unrelated changes when saved with an editor that removes them.
  • There were a couple of runaway code blocks without closing backticks.
  • There were ordered lists where numbers were repeated or missing from between
  • There were incorrectly rendering ordered lists because of indentation
  • There were hard tabs
  • There were multiple sequential blank lines
  • Blank lines around headers, tables, lists and code blocks were randomly there or not
  • There were multiple cases of skipping heading levels (from ## straight to #### without ### in between, heading used to create bold?)
  • Several code/yaml blocks were missing the language tag after backticks
  • The command example code blocks were normalized: when command examples display output, the command is prefixed with $, when they do not display any output, the $ is omitted to ease copypasting)

These are all things the linter will check for.

It was a lot of trouble to make it pass, but I'd say it's worth it because obvious mistakes were catched and will be automatically catched from now on (also forced linting makes diffs smaller).

@kke kke added the documentation Improvements or additions to documentation label May 24, 2021
@kke kke requested a review from a team as a code owner May 24, 2021 11:03
@kke kke requested review from ncopa and jnummelin May 24, 2021 11:03
jasmingacic
jasmingacic previously approved these changes May 24, 2021
@kke kke marked this pull request as draft May 24, 2021 11:30
Signed-off-by: Kimmo Lehto <[email protected]>

Add github workflow for linting markdown

Signed-off-by: Kimmo Lehto <[email protected]>

Finetuning

Signed-off-by: Kimmo Lehto <[email protected]>

More tuning

Signed-off-by: Kimmo Lehto <[email protected]>

Path?

Signed-off-by: Kimmo Lehto <[email protected]>

Huge amount of manual fixes

Signed-off-by: Kimmo Lehto <[email protected]>

Second batch

Signed-off-by: Kimmo Lehto <[email protected]>

Third batch

Signed-off-by: Kimmo Lehto <[email protected]>

Does it need four indent?

Signed-off-by: Kimmo Lehto <[email protected]>

Maybe passes now

Signed-off-by: Kimmo Lehto <[email protected]>

Markdown is serious business

Signed-off-by: Kimmo Lehto <[email protected]>

Should be the last error

Signed-off-by: Kimmo Lehto <[email protected]>
@kke kke force-pushed the markdown-cleanup branch from 1660f9a to 9f6de1d Compare May 25, 2021 06:34
@kke kke changed the title Remove trailing whitespace from all markdowns Lint markdown in doc PRs May 25, 2021
@kke kke marked this pull request as ready for review May 25, 2021 06:44
@kke kke requested a review from jasmingacic May 25, 2021 06:44
@kke kke changed the title Lint markdown in doc PRs Add GH action to lint markdown files May 25, 2021
@kke kke requested a review from mviitane May 25, 2021 06:48
@kke kke mentioned this pull request May 25, 2021
Copy link
Contributor

@jasmingacic jasmingacic left a comment

Choose a reason for hiding this comment

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

looks legit

@kke kke merged commit be06618 into k0sproject:main May 25, 2021
@kke kke deleted the markdown-cleanup branch May 25, 2021 12:59
jnummelin pushed a commit to jnummelin/k0s that referenced this pull request Jun 10, 2021
Signed-off-by: Kimmo Lehto <[email protected]>

Add github workflow for linting markdown

Signed-off-by: Kimmo Lehto <[email protected]>

Finetuning

Signed-off-by: Kimmo Lehto <[email protected]>

More tuning

Signed-off-by: Kimmo Lehto <[email protected]>

Path?

Signed-off-by: Kimmo Lehto <[email protected]>

Huge amount of manual fixes

Signed-off-by: Kimmo Lehto <[email protected]>

Second batch

Signed-off-by: Kimmo Lehto <[email protected]>

Third batch

Signed-off-by: Kimmo Lehto <[email protected]>

Does it need four indent?

Signed-off-by: Kimmo Lehto <[email protected]>

Maybe passes now

Signed-off-by: Kimmo Lehto <[email protected]>

Markdown is serious business

Signed-off-by: Kimmo Lehto <[email protected]>

Should be the last error

Signed-off-by: Kimmo Lehto <[email protected]>

Co-authored-by: Kimmo Lehto <[email protected]>
mikhail-sakhnov pushed a commit to mikhail-sakhnov/k0s that referenced this pull request Jun 28, 2021
Signed-off-by: Kimmo Lehto <[email protected]>

Add github workflow for linting markdown

Signed-off-by: Kimmo Lehto <[email protected]>

Finetuning

Signed-off-by: Kimmo Lehto <[email protected]>

More tuning

Signed-off-by: Kimmo Lehto <[email protected]>

Path?

Signed-off-by: Kimmo Lehto <[email protected]>

Huge amount of manual fixes

Signed-off-by: Kimmo Lehto <[email protected]>

Second batch

Signed-off-by: Kimmo Lehto <[email protected]>

Third batch

Signed-off-by: Kimmo Lehto <[email protected]>

Does it need four indent?

Signed-off-by: Kimmo Lehto <[email protected]>

Maybe passes now

Signed-off-by: Kimmo Lehto <[email protected]>

Markdown is serious business

Signed-off-by: Kimmo Lehto <[email protected]>

Should be the last error

Signed-off-by: Kimmo Lehto <[email protected]>

Co-authored-by: Kimmo Lehto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants