Skip to content

Conversation

epage
Copy link
Contributor

@epage epage commented Aug 19, 2025

Taken from a style team discussion.

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

@epage epage added the F-frontmatter `#![feature(frontmatter)]` label Aug 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 19, 2025

r? @calebcartwright

rustbot has assigned @calebcartwright.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-style Relevant to the style team, which will review and decide on the PR/issue. labels Aug 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 19, 2025

Some changes occurred in src/doc/style-guide

cc @rust-lang/style

@rustbot

This comment has been minimized.

@epage
Copy link
Contributor Author

epage commented Aug 19, 2025

CC @calebcartwright

From rust-lang/style-team#212 (comment)

Before anything else, let's confirm if @calebcartwright is in agreement with the above.

@joshtriplett
Copy link
Member

joshtriplett commented Aug 21, 2025

I don't need to specify the lack of trailing spaces after the code fence / infostring

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.

We aren't specifying when to include the infostring (one idea being if there is no shebang)

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

Keep it simple and have a single example instead of showing allowed several variations

Seems fine.

@traviscross
Copy link
Contributor

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.

Agreed. I'd want rustfmt to normalize out trailing spaces.

@joshtriplett
Copy link
Member

#145735

jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 25, 2025
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
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 26, 2025
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
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 26, 2025
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
rust-timer added a commit that referenced this pull request Aug 26, 2025
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
@rustbot

This comment has been minimized.

github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Aug 28, 2025
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
@rustbot

This comment has been minimized.

@rustbot

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
@rustbot
Copy link
Collaborator

rustbot commented Sep 4, 2025

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.

fmease added a commit to fmease/rust that referenced this pull request Sep 5, 2025
…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 .
rust-timer added a commit that referenced this pull request Sep 6, 2025
Rollup merge of #145735 - joshtriplett:style-guide-trailing-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 #145617 .
mohe2015 pushed a commit to tucan-plus/rustfmt that referenced this pull request Sep 6, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-frontmatter `#![feature(frontmatter)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-style Relevant to the style team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Styling of Rust Frontmatter
5 participants