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 linting for markdown files #883

Merged
merged 5 commits into from
Jul 20, 2023
Merged

Conversation

kate-osborn
Copy link
Contributor

@kate-osborn kate-osborn commented Jul 18, 2023

Proposed changes

Problem: The markdown files in the repo were not linted.

Solution: Add markdownlint step to pre-commit. All markdown files except the .github files will be linted before every commit. Markdownlint will attempt to fix the linting errors and will report any errors it cannot fix. Linting rules are in the .markdownlint-cli2.yaml file in the root of the repo. For details on the linting rules, see: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md

Testing: Verified markdown files are linted on pre-commit.

Closes #555

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@kate-osborn kate-osborn requested a review from a team as a code owner July 18, 2023 20:33
@github-actions github-actions bot added chore Pull requests for routine tasks documentation Improvements or additions to documentation labels Jul 18, 2023
Copy link
Member

@lucacome lucacome 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 adding this!
I left a comment about markdown-cli vs markdown-cli2. Also do we want the CI to autofix the problems? Or just flag them like the other linters?
If it's the latter we can add https://github.com/xt0rted/markdownlint-problem-matcher or https://github.com/marketplace/actions/markdownlint-cli2-action to the linter workflow.

.pre-commit-config.yaml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
@kate-osborn
Copy link
Contributor Author

Thanks for adding this! I left a comment about markdown-cli vs markdown-cli2. Also do we want the CI to autofix the problems? Or just flag them like the other linters? If it's the latter we can add https://github.com/xt0rted/markdownlint-problem-matcher or https://github.com/marketplace/actions/markdownlint-cli2-action to the linter workflow.

Good question about autofix in the pipelines. I think we just want to flag them in the pipeline. @sjberman @pleshakov what do you think?

@sjberman
Copy link
Contributor

Thanks for adding this! I left a comment about markdown-cli vs markdown-cli2. Also do we want the CI to autofix the problems? Or just flag them like the other linters? If it's the latter we can add https://github.com/xt0rted/markdownlint-problem-matcher or https://github.com/marketplace/actions/markdownlint-cli2-action to the linter workflow.

Good question about autofix in the pipelines. I think we just want to flag them in the pipeline. @sjberman @pleshakov what do you think?

As long as it's consistent, that's all that matters to me!

@pleshakov
Copy link
Contributor

Good question about autofix in the pipelines. I think we just want to flag them in the pipeline. @sjberman @pleshakov what do you think?

@kate-osborn
I'd prefer flagging. I'd rather retain control over the contents of my PR. I think that will be consistent with our other checks, that do not add any commits/fix problems in place.

Copy link
Member

@lucacome lucacome left a comment

Choose a reason for hiding this comment

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

🚀

.markdownlint-cli2.yaml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
@kate-osborn kate-osborn merged commit 5bf78d8 into nginxinc:main Jul 20, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks documentation Improvements or additions to documentation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Chore: Add linting for markdown files
4 participants