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

setup markdownlint #1382

Merged
merged 14 commits into from
Jul 18, 2024
Merged

setup markdownlint #1382

merged 14 commits into from
Jul 18, 2024

Conversation

HarshCasper
Copy link
Member

@HarshCasper HarshCasper commented Jul 17, 2024

Introduction

This PR introduces configuration files for markdownlint 1 and the related markdownlint-cli2 2. Additionally, we have introduced the custom Markdownlint rule max-one-sentence-per-line 3 to ensure that we adher to one-sentence-per-line rule going forward.

Ignored Rules

As part of this exercise, we opted to ignore a few rules, in the interest of time and effort. They are:

  • MD029: Ordered list item prefix
  • MD046: Code block style
  • MD025: Single H1
  • MD001: Header levels increment by one
  • MD024: Multiple headers with the same content
  • MD055: Inconsistent leading and trailing pipe characters
  • MD056: Inconsistent Table column count
  • MD036: Emphasis used instead of a header
  • MD003: Header style
  • MD033: Inline HTML
  • MD013: Line length
  • MD034: Bare URL used
  • MD032: Lists should be surrounded by blank lines

We hope to progressively fix them over the time but they are not the current priority.

GitHub Action

This PR also introduces a GitHub Action 4 that runs only on changed files every pull request.

Pre-Commit Hook

This PR also introduces a Pre-commit hook to run the lint process locally to reduce the feedback cycle.

Next Steps

Service owners should review the docs that they own and report to us if Markdownlint has inadvertently made unexpected changes.

Copy link

github-actions bot commented Jul 17, 2024

🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-1382.surge.sh 🎊

Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

It would be great if you could add a description to the PR such that reviewers can get an insight of what you want to accomplish with the changes here.

@HarshCasper
Copy link
Member Author

@alexrashed — I was in the process of writing that :)

I hope the current description gives an idea of what we are looking to accomplish.

@HarshCasper HarshCasper requested review from alexrashed and removed request for pinzon, sannya-singal, lukqw and bentsku July 17, 2024 06:21
@HarshCasper HarshCasper requested a review from remotesynth July 17, 2024 06:23
Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for the detailed explanation! Automation / linting around our best practices has often proven to be very effective and helpful!

In other repositories we use pre-commit (there is an offical one for markdownlint), which helps contributors to get notified on issues in their files right when they commit the changes locally.
It would also be great if you could fix the last remaining issues in the code, if there's a lot we could also try to get codeowners on board?

And another tip on the side (which I think won't be necessary for this changeset): If you want to protect the Git history / blame views from being polluted by formatter changes, you can use .git-blame-ignore-revs to ignore specific commits (later on). However, for that you would have to separate the configuration of the linting tools from the actual formatting...

@HarshCasper
Copy link
Member Author

Thank You @alexrashed for the feedback — I'll setup the pre-commit hook and revisit the .git-blame-ignore-revs later on 👍

Copy link
Member

Choose a reason for hiding this comment

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

@HarshCasper: just as an FYI - all the coverage files are auto-generated (by the Update Parity Docs workflow) - I think we should either make sure that the workflow runs the format as well, or adapt the template for the file creation :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I will adapt the workflow to run the format as well 👍

content/en/user-guide/aws/ec2/index.md Outdated Show resolved Hide resolved
content/en/references/cross-account-access.md Outdated Show resolved Hide resolved
content/en/references/cross-account-access.md Outdated Show resolved Hide resolved
content/en/references/cross-account-access.md Show resolved Hide resolved
content/en/references/cross-account-access.md Outdated Show resolved Hide resolved
content/en/references/cross-account-access.md Outdated Show resolved Hide resolved
Copy link
Contributor

@remotesynth remotesynth left a comment

Choose a reason for hiding this comment

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

I didn't go through all 336 changed files of course, but the preview looks fine and the additions seem fine as well.

Copy link
Contributor

@macnev2013 macnev2013 left a comment

Choose a reason for hiding this comment

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

Thanks for jumping on it. I've gone through my services. LGTM 🚀

Copy link
Member

@viren-nadkarni viren-nadkarni left a comment

Choose a reason for hiding this comment

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

I recommend also verifying all changes yourself because not all pages have owners.

content/en/references/coverage/_index.md Outdated Show resolved Hide resolved
content/en/references/lambda-provider-v2.md Outdated Show resolved Hide resolved
# endpoint url

Copy link
Member

Choose a reason for hiding this comment

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

Changes in this file are invalid

Copy link
Member

@steffyP steffyP left a comment

Choose a reason for hiding this comment

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

Nice work! I think having this formatting in place will make things moving forward. 🚀

My only remarks left:

  1. please add a note to the README regarding the pre-commit hook
  2. please make sure that the workflow for updating parity docs still work - either trigger the workflow (against this branch), or after we merged this. Only want to make sure everything runs smoothly 🙂

@HarshCasper HarshCasper merged commit f2ebb42 into main Jul 18, 2024
5 checks passed
@HarshCasper HarshCasper deleted the markdownlint branch July 18, 2024 14:54
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.

6 participants