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

#347: Add markdownlint-cli2 as Github Action and pre-commit hook #354

Conversation

nifadyev
Copy link
Contributor

@nifadyev nifadyev commented Oct 23, 2024

Resolves #347

pre-commit will be properly set up after #350 is merged

@satwikkansal , please analyze the markdownlint-cli2 output and decide, what errors are better to ignore

sample Github action output

Errors frequency for current README.md:

  • 303 MD013 - Line length (expected 80)
  • 254 MD004 - Unordered list style [Expected: dash; Actual: asterisk]
  • 177 MD031 - Fenced code blocks should be surrounded by blank lines
  • 67 MD026 - Trailing punctuation in heading [Punctuation: '!']
  • 62 MD024 - Multiple headings with the same content [Context: "💡 Explanation:"]
  • 39 MD032 - Lists should be surrounded by blank lines
  • 30 MD012 - Multiple consecutive blank lines [Expected: 1; Actual: 2]
  • 23 MD022 - Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below]
  • 22 MD009 - Trailing spaces [Expected: 0 or 2; Actual: 5]
  • 14 MD034 - Bare URL used
  • 9 MD040 - Fenced code blocks should have a language specified
  • 8 MD036 - Emphasis used instead of a heading [Context: "Output"]
  • 7 MD007 - Unordered list indentation [Expected: 2; Actual: 4]
  • 3 MD030 - Spaces after list markers [Expected: 1; Actual: 2]
  • 2 MD001 - Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]
  • 2 MD014 - Dollar signs used before commands without showing output [Context: "$ wtfpython"]
  • 2 MD038 - Spaces inside code span elements [Context: "(a, 9) "]
  • 2 MD029 - Ordered list item prefix [Expected: 1; Actual: 2; Style: 1/1/1]
  • 2 MD049 - Emphasis style [Expected: asterisk; Actual: underscore]
  • 1 MD041 - First line in a file should be a top-level heading
  • 1 MD051 - Link fragments should be valid [Context: "[More content like this?](#more-content-like-this)"]
  • 1 MD019 - Multiple spaces after hash on atx style heading [Context: "#### 💡 Explanation:"]
  • 1 MD027 - Multiple spaces after blockquote symbol [Context: " > If sep is not specified..."]

@satwikkansal
Copy link
Owner

Hi @nifadyev, let's ignore MD026, MD024, MD034, rest of all look reasonable to me, your thoughts?

@nifadyev
Copy link
Contributor Author

nifadyev commented Oct 28, 2024

I agree with you, except MD034 - most URLs should be hidden using []() Markdown format. And MD033 should probably be ignored as well, html is used for image formatting and changing it based on light/dark theme

Is line length set to 80 OK to you?

Another question is how to format the files. I'd prefer to format them gradually, making PRs with no more than 500 changed lines. It will ease review and reduce missing errors

@satwikkansal
Copy link
Owner

I agree with you, except MD034 - most URLs should be hidden using Markdown format.

Yes, but sometimes it's okay to have them displayed in raw format, when I want the site to be attributed transparently, because otherwise we have to un-necesarily explain where the link directs.

And MD033 should probably be ignored as well, html is used for image formatting and changing it based on light/dark theme

There was no mention of MD033 in the report in first comment, but yes, having HTML is okay.

Is line length set to 80 OK to you?

I prefer higher length like 120 or 140.

I'd prefer to format them gradually, making PRs with no more than 500 changed lines. It will ease review and reduce missing errors

I'd say fix everything in 1 go with autofix, and then whatever can't be fixed we can do incremental fixes.

@nifadyev
Copy link
Contributor Author

Agreed on ignored rules and how to format files. I will make changes in this PR soon

@nifadyev
Copy link
Contributor Author

Hey @satwikkansal , I've used autofix to format README.md. Now there are 268 errors and most of them - line lengths. I guess they should be fixed separately.

Copy link
Owner

@satwikkansal satwikkansal left a comment

Choose a reason for hiding this comment

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

@nifadyev Looks good! Let's change the base to dev and merge.

@nifadyev nifadyev changed the base branch from master to dev November 2, 2024 04:26
@nifadyev
Copy link
Contributor Author

nifadyev commented Nov 5, 2024

@satwikkansal , base branch has been changed to dev

@satwikkansal satwikkansal merged commit 15429d0 into satwikkansal:dev Nov 5, 2024
@satwikkansal
Copy link
Owner

Merged 🚀

@nifadyev nifadyev deleted the feature/#347/configure-markdown-linter-and-formatter branch November 5, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add markdown linter and formatter
2 participants