Update project .markdownlintrc file#6990
Merged
Merged
Conversation
After discovering the Google markdown style guide at https://google.github.io/styleguide/docguide/style.html, it seemed sensible to make our markdownlint configuration try to be as close to the Google style as possible while still being compatible with GitHub-flavored Markdown. This new config file tries to achieve that. This update also changes the file format to JSONC. I was unable to make the ini-style syntax work for the `allowed_elements` list under `html`, and after spending far too long trying to figure out why, gave up after realizing that such a waste of time might hit the next person trying to edit the file. (Markdownlint ignores the `.markdownlintrc` file if it contains a syntax error, but it _doesn't report what the error is_, leaving it up to you to guess what's wrong. That's just asinine. By contrast, when using JSONC format for `.markdownlintrc`, it will report errors.)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6990 +/- ##
=======================================
Coverage 97.89% 97.89%
=======================================
Files 1085 1085
Lines 95034 95034
=======================================
Hits 93032 93032
Misses 2002 2002 ☔ View full report in Codecov by Sentry. |
This adds `first-line-heading` setting, to bring another behavior closer to Google Markdown style. I also moved the two headings-related settings next to each other, to organize the content a little bit better.
Turns out there's a JSON schema for this file format.
Emacs was not noticing the -*- jsonc -*- mode setting.
Despite the suspicious look of having a comment right after the
opening `{` brace, I tested it with the markdownlint program and it
does read the file without complaint.
Embarrassingly, I only now read the section on list spacing in https://google.github.io/styleguide/docguide/style.html#lists
Contributor
Author
|
Just a note that the failing workflows are unrelated to this PR. It seems a recent PR affected one of the CI checks. |
pavoljuhas
approved these changes
Jan 29, 2025
pavoljuhas
left a comment
Collaborator
There was a problem hiding this comment.
LGTM assuming markdownlint can digest this without complaints.
Thank you for taking care of this!
Contributor
Author
Yes, I've been using it on the Markdown README files in the other PRs, and it's been working fine (and catching my mistakes). |
BichengYing
pushed a commit
to BichengYing/Cirq
that referenced
this pull request
Jun 20, 2025
* Update .markdownlintrc After discovering the Google markdown style guide at https://google.github.io/styleguide/docguide/style.html, it seemed sensible to make our markdownlint configuration try to be as close to the Google style as possible while still being compatible with GitHub-flavored Markdown. This new config file tries to achieve that. This update also changes the file format to JSONC. I was unable to make the ini-style syntax work for the `allowed_elements` list under `html`, and after spending far too long trying to figure out why, gave up after realizing that such a waste of time might hit the next person trying to edit the file. (Markdownlint ignores the `.markdownlintrc` file if it contains a syntax error, but it _doesn't report what the error is_, leaving it up to you to guess what's wrong. That's just asinine. By contrast, when using JSONC format for `.markdownlintrc`, it will report errors.) * Add first-line-heading This adds `first-line-heading` setting, to bring another behavior closer to Google Markdown style. I also moved the two headings-related settings next to each other, to organize the content a little bit better. * Add $schema keyword Turns out there's a JSON schema for this file format. * Start top comment on first line of file Emacs was not noticing the -*- jsonc -*- mode setting. Despite the suspicious look of having a comment right after the opening `{` brace, I tested it with the markdownlint program and it does read the file without complaint. * Add settings for Google list style guidelines Embarrassingly, I only now read the section on list spacing in https://google.github.io/styleguide/docguide/style.html#lists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After discovering the Google markdown style guide at https://google.github.io/styleguide/docguide/style.html, it seemed sensible to make our markdownlint configuration try to be as close to the Google style as possible while still being compatible with GitHub-flavored Markdown. This new config file tries to achieve that.
This update also changes the file format to JSONC. I was unable to make the ini-style syntax work for the
allowed_elementslist underhtml, and after spending far too long trying to figure out why, gave up after realizing that such a waste of time might hit the next person trying to edit the file. (Markdownlint ignores the.markdownlintrcfile if it contains a syntax error, but it doesn't report what the error is, leaving it up to you to guess what's wrong. That's just asinine. By contrast, when using JSONC format for.markdownlintrc, it will report errors.)