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

Consider using a linter for markdown files #3543

Closed
3 tasks
colin-axner opened this issue May 3, 2023 · 12 comments
Closed
3 tasks

Consider using a linter for markdown files #3543

colin-axner opened this issue May 3, 2023 · 12 comments

Comments

@colin-axner
Copy link
Contributor

Summary

It can be useful to lint our markdown files for consistency. Adding this tooling into our workflow would prevent reviewing unnecessary diffs when a linter is run on the markdown files.

see related comment thread


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@DimitrisJim
Copy link
Contributor

DimitrisJim commented May 3, 2023

We do already have a docs-lint rule in the Makefile and its a suggestion in the Development Setup. Frankly, I also just learned it exists 😄

@colin-axner
Copy link
Contributor Author

Should we add this to our ci checks?

@DimitrisJim
Copy link
Contributor

DimitrisJim commented May 3, 2023

we should ask @damiannolan since we know how much love he has for linters complaining to him (but yeah, I'd say it would be a good idea).

@damiannolan
Copy link
Member

We have make docs-lint and make docs-lint-changed, both of which use this markdownlint tool afaik.

IMO adding a CI check for this might be a little overkill, especially since we're already pushing limits on GH runners. We could enforce a pre-commit hook, I think @chatton already uses one in his local setup which makes use of docs-lint-changed as well as lint-fix-changed (for golangci-lint)

@DimitrisJim
Copy link
Contributor

IMO adding a CI check for this might be a little overkill, especially since we're already pushing limits on GH runners

Can't we set it to only run when changes to docs/ are triggered?

@damiannolan
Copy link
Member

Yeah true

@srdtrk
Copy link
Member

srdtrk commented May 6, 2023

Most files are already linted. The real issue is that we don't have a custom ruleset for our project. Markdownlinter's default settings will result in markdown files that reflect the author's preferred markdown authoring preferences. This is what causes inconsistency in our docs. I think we can rename this issue to something like Define custom markdownlint ruleset configuration

@DimitrisJim
Copy link
Contributor

do we not have .markdownlint.jsonc for the rules? The idea of the issue as I understood it is to have markdownlint run on new changes to guarantee consistency.

@srdtrk
Copy link
Member

srdtrk commented May 15, 2023

We do @DimitrisJim, however, it is not customised enough. It just tells the linter to ignore some settings. Currently the style settings are still set to default. This includes things like heading style, indentations, unordered list style and more. For example, the fix to the comment thread @colin-axner linked in this issue would be to add

  "MD004": {
    "style": "dash"
  },

This is why Colin noticed some files being changed * => - and others - => * by the linter.

@srdtrk
Copy link
Member

srdtrk commented May 19, 2023

I'm addressing this issue in the next docs PR

@srdtrk
Copy link
Member

srdtrk commented Jun 9, 2023

I've factored this out of the docs PR, and instead, linter/workflow related changes will have their own PR

@crodriguezvega
Copy link
Contributor

Closed by #3805

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

No branches or pull requests

5 participants