Skip to content

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

Merged
merged 6 commits into from
Apr 25, 2024
Merged

chore(maintenance): add markdownlint #2434

merged 6 commits into from
Apr 25, 2024

Conversation

dreamorosi
Copy link
Contributor

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 via lint-staged, which will lint and fix only on staged files that are about to be committed (remember to run npx 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

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective and works
  • The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

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.

@dreamorosi dreamorosi self-assigned this Apr 25, 2024
@dreamorosi dreamorosi requested a review from a team April 25, 2024 09:53
@dreamorosi dreamorosi requested a review from a team as a code owner April 25, 2024 09:53
@boring-cyborg boring-cyborg bot added dependencies Changes that touch dependencies, e.g. Dependabot, etc. documentation Improvements or additions to documentation internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) labels Apr 25, 2024
@pull-request-size pull-request-size bot added the size/XL PRs between 500-999 LOC, often PRs that grown with feedback label Apr 25, 2024
@boring-cyborg boring-cyborg bot added the automation This item relates to automation label Apr 25, 2024
@dreamorosi dreamorosi linked an issue Apr 25, 2024 that may be closed by this pull request
2 tasks
Copy link
Contributor

@am29d am29d left a 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.

@dreamorosi
Copy link
Contributor Author

dreamorosi commented Apr 25, 2024

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

@dreamorosi dreamorosi requested a review from am29d April 25, 2024 10:42
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@am29d am29d merged commit 3c294d3 into main Apr 25, 2024
12 checks passed
@am29d am29d deleted the chore/markdownlint branch April 25, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation This item relates to automation dependencies Changes that touch dependencies, e.g. Dependabot, etc. documentation Improvements or additions to documentation internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) size/XL PRs between 500-999 LOC, often PRs that grown with feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: start linting markdown files
2 participants