-
Couldn't load subscription status.
- Fork 13.9k
docs(style): Specify the frontmatter style #145617
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
|
rustbot has assigned @calebcartwright. Use |
|
Some changes occurred in src/doc/style-guide cc @rust-lang/style |
This comment has been minimized.
This comment has been minimized.
|
From rust-lang/style-team#212 (comment)
|
We don't actually have a general specification of that anywhere (just one specific to doc comments), so it may be worth specifying, until we add a more general prohibition.
I don't think we should specify whether to include or exclude the infostring; that's outside the scope of formatting (at least, until a hypothetical future in which we know how to format certain types of infostrings).
Seems fine. |
Agreed. I'd want rustfmt to normalize out trailing spaces. |
4c5e6c9 to
3b2ae98
Compare
test(rustfmt): Verify frontmatter is preserved This is to prove that the frontmatter is preserved. The choices in tests is intended for showing the different parts of the proposed Style Guide for frontmatters (rust-lang#145617). While rustfmt is developed in a different repo, work involving upstream integration is blocked on some work that is being finished up in that repo. I was told that it would be ok to post against this repo in the mean time. Tracking issue: rust-lang#136889
test(rustfmt): Verify frontmatter is preserved This is to prove that the frontmatter is preserved. The choices in tests is intended for showing the different parts of the proposed Style Guide for frontmatters (rust-lang#145617). While rustfmt is developed in a different repo, work involving upstream integration is blocked on some work that is being finished up in that repo. I was told that it would be ok to post against this repo in the mean time. Tracking issue: rust-lang#136889
test(rustfmt): Verify frontmatter is preserved This is to prove that the frontmatter is preserved. The choices in tests is intended for showing the different parts of the proposed Style Guide for frontmatters (rust-lang#145617). While rustfmt is developed in a different repo, work involving upstream integration is blocked on some work that is being finished up in that repo. I was told that it would be ok to post against this repo in the mean time. Tracking issue: rust-lang#136889
Rollup merge of #145766 - epage:rustfmt, r=calebcartwright test(rustfmt): Verify frontmatter is preserved This is to prove that the frontmatter is preserved. The choices in tests is intended for showing the different parts of the proposed Style Guide for frontmatters (#145617). While rustfmt is developed in a different repo, work involving upstream integration is blocked on some work that is being finished up in that repo. I was told that it would be ok to post against this repo in the mean time. Tracking issue: #136889
This comment has been minimized.
This comment has been minimized.
test(rustfmt): Verify frontmatter is preserved This is to prove that the frontmatter is preserved. The choices in tests is intended for showing the different parts of the proposed Style Guide for frontmatters (rust-lang/rust#145617). While rustfmt is developed in a different repo, work involving upstream integration is blocked on some work that is being finished up in that repo. I was told that it would be ok to post against this repo in the mean time. Tracking issue: rust-lang/rust#136889
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Taken from [a style team discussion](rust-lang/style-team#212 (comment)). Assumptions on my part: - I don't need to specify the lack of trailing spaces after the code fence / infostring - We aren't specifying when to include the infostring (one idea being if there is no shebang) - Keep it simple and have a single example instead of showing allowed several variations
…whitespace, r=joshtriplett style-guide: Document absence of trailing whitespace We didn't previously have a blanket prohibition on trailing whitespace. Adding one, inspired by discussion in rust-lang#145617 .
test(rustfmt): Verify frontmatter is preserved This is to prove that the frontmatter is preserved. The choices in tests is intended for showing the different parts of the proposed Style Guide for frontmatters (rust-lang/rust#145617). While rustfmt is developed in a different repo, work involving upstream integration is blocked on some work that is being finished up in that repo. I was told that it would be ok to post against this repo in the mean time. Tracking issue: rust-lang/rust#136889
|
Let's do it. In particular, we're deciding to accept the following set of decisions, from rust-lang/style-team#212 (comment):
@rfcbot fcp merge |
|
Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
| There should be no blank lines between the frontmatter and either the start of the file or a shebang. | ||
| There can be zero or one line between the frontmatter and any following content. | ||
|
|
||
| The frontmatter fences should use the minimum number of dashes necessary for the contained content (one more than the longest series of initial dashes in the | ||
| content, with a minimum of 3 to be recognized as frontmatter delimiters). | ||
| If an infostring is present after the opening fence, there should be one space separating them. | ||
| The frontmatter fence lines should not have trailing whitespace. |
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.
Most of the style guide is consistently wrapped at 80 columns. The remainder of this chapter, though, is not hard wrapped at all. It seems we should do one of the two.
@joshtriplett, do you have thoughts about the style guide for the style guide?
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.
I don't think it's ever anything that's been enforced (once upon a time before the style guide was in this repo I'd merge text and modify it after versus asking the author).
If we are going to try to maintain consistency then maybe it could be incorporated into the tidy checks someday?
For now my .02 would be to proceed and circle back to it if/when we make that decision
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.
(once upon a time before the style guide was in this repo I'd merge text and modify it after versus asking the author).
Similarly to that, we could push a commit ourselves to this branch doing it, then merge it.
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.
I don't think it's ever anything that's been enforced...
I had looked through all the chapters before asking. They're mostly wrapped at 80, with a handful of sections wrapped closer to 90 or 95, and then there's the types chapter where two sections are unwrapped and the nightly chapter that is unwrapped.
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.
Agreed that we should merge for now and attempt to apply consistency later.
Broadly speaking I think the style guide should be wrapped the way other markdown files are typically wrapped: at 80 columns.
The primary exception would be code examples, which might extend to 100 columns to match normal Rust style, and conversely might be wrapped oddly to demonstrate something.
|
This passed FCP, and the only outstanding question was the question about consistent wrapping width in the style guide. That doesn't affect the correctness of the content, or for that matter the rendering of the content. Given that: @bors r+ rollup |
Rollup of 5 pull requests Successful merges: - #145617 (docs(style): Specify the frontmatter style) - #147830 (Reword unstable fingerprints ICE to ask for reproduction) - #147988 (Remove unused field `style` from `AttributeKind::CrateName`) - #147990 (Fix invalid jump to def link generated on derive attributes) - #147991 ([rustdoc] Check `doc(cfg())` even of private/hidden items) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #145617 - epage:style, r=joshtriplett docs(style): Specify the frontmatter style Taken from [a style team discussion](rust-lang/style-team#212 (comment)). Assumptions on my part: - I specify that frontmatter fences should not have trailing whitespace - We aren't specifying when to include the infostring (one idea being if there is no shebang) - Keep it simple and have a single example instead of showing allowed several variations Tracking issue: #136889 Closes rust-lang/style-team#212
Taken from a style team discussion.
Assumptions on my part:
Tracking issue: #136889
Closes rust-lang/style-team#212