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

nonspec: add instructions for checking markdown formatting #1096

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ style, as encoded in our [markdownlint configuration](.markdownlint.yaml). In
addition we prefer to keep our Markdown documents wrapped at 80 columns (though
this is not currently enforced).

To check (and fix) style problems before sending a PR you can install
and run [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2).
Copy link
Member

Choose a reason for hiding this comment

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

Oh, I haven't played with this (I typically just run the same command as the GHA workflow: npm run lint && ./lint.sh

Do you know if this CLI uses our .markdownlint.yaml and .markdownlintignore ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You know, I didn't:

  1. Know exactly how it worked already.
  2. Know that it supported fixing via format.
  3. Know how to get it working.

It looks like markdownlint-cli2 does support .markdownlint.yaml, but the .markdownlintignore is 'different' and the compatibility isn't quite right.

So I figured out how to use the same tooling as the workflow.


```shell
$ markdownlint-cli2 CONTRIBUTING.md
markdownlint-cli2 v0.13.0 (markdownlint v0.34.0)
Finding: CONTRIBUTING.md
Linting: 1 file(s)
Summary: 2 error(s)
CONTRIBUTING.md:70 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]
CONTRIBUTING.md:71 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "### Pull request conventions"]
$ markdownlint-cli2 CONTRIBUTING.md --fix
markdownlint-cli2 v0.13.0 (markdownlint v0.34.0)
Finding: CONTRIBUTING.md
Linting: 1 file(s)
Summary: 0 error(s)
$
```

### Pull request conventions

[pull request conventions]: #pull-request-conventions
Expand Down