-
Notifications
You must be signed in to change notification settings - 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
base: master
Are you sure you want to change the base?
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
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
…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.
Taken from a style team discussion.
Assumptions on my part:
Tracking issue: #136889
Closes rust-lang/style-team#212