-
Notifications
You must be signed in to change notification settings - Fork 155
chore(maintenance): add markdownlint #2434
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
Conversation
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 addition! I tested few formatting errors and the error messages are spot on what's wrong, where and what to fix ✅.
Just two comments on the configuration, it seems like they are not valid based on the JSON schema of markdownlint? Maybe I am missing something.
No, you're right - I copied the config from the Python repo assuming it was correct but the two settings you pointed out are either missing or have been removed, they don't appear anymore in the docs for the tool either. I have removed them both! I also opened an issue in aws-powertools/powertools-lambda-python#4208 |
|
Description of your changes
This PR introduces markdown linting to the project. This will enforce an objective baseline for style and format of markdown files.
To support this I have added markdownlint-cli2 to the workspace, this is the same CLI used by Powertools for AWS Lambda (Python) from which I also copied the rule set.
Linting is run automatically as
pre-commit
hook vialint-staged
, which will lint and fix only on staged files that are about to be committed (remember to runnpx husky
to make it take effect), and also as PR check. The latter runs on all markdown files in scope.The tool supports an ignore file, which I also added to the project, however I was able to make this file work only with the IDE extension but not the CLI, for this reason I replicated the patterns in the command I added to the
package.json
.For the time being I have ignored the
package/*/README.md
files since there are opened issues already for these, once we tackle them we will remove them from the ignore list.Finally, if you are using VSCode, I recommend to install the markdownlint which will surface the issues according to the ruleset defined and can also be configured to format on save.
Related issues, RFCs
Issue number: #2399
Checklist
Breaking change checklist
Is it a breaking change?: NO
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.