-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
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
Just a note that the failing workflows are unrelated to this PR. It seems a recent PR affected one of the CI checks. |
There was a problem hiding this 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!
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). |
* 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
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 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.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.)