Skip to content

Update project .markdownlintrc file #6990

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 7 commits into from
Jan 29, 2025

Conversation

mhucka
Copy link
Contributor

@mhucka mhucka commented Jan 28, 2025

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.)

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.)
Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.89%. Comparing base (836d70f) to head (914b3af).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

mhucka and others added 6 commits January 28, 2025 10:51
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.
@mhucka
Copy link
Contributor Author

mhucka commented Jan 29, 2025

Just a note that the failing workflows are unrelated to this PR. It seems a recent PR affected one of the CI checks.

@mhucka mhucka marked this pull request as ready for review January 29, 2025 01:02
@mhucka mhucka requested review from vtomole and a team as code owners January 29, 2025 01:02
Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

LGTM assuming markdownlint can digest this without complaints.

Thank you for taking care of this!

@mhucka
Copy link
Contributor Author

mhucka commented Jan 29, 2025

LGTM assuming markdownlint can digest this without complaints.

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).

@mhucka mhucka added this pull request to the merge queue Jan 29, 2025
Merged via the queue into quantumlib:main with commit 785fd1c Jan 29, 2025
34 of 38 checks passed
@mhucka mhucka deleted the mhucka-update-markdownlintrc branch January 29, 2025 04:41
@mhucka mhucka changed the title Update .markdownlintrc Update project .markdownlintrc file Apr 8, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants