Skip to content

Conversation

@Manishearth
Copy link
Member

@Manishearth Manishearth commented Oct 8, 2025

See zulip thread

I'm making a (potentially temporary) rustfmt-contributors team that contains additional people with merge access on the rustfmt repo. I'm seeding it with myself and @fee1-dead, though I hope to add @camsteffen and @jieyouxu to it if they perform some reviews or otherwise participate more (I'm also happy to just seed with them from the get-go).

My plan is to start getting small PRs landed, and potentially start doing triage and other medium-term things.

I've discussed this plan with @ytmimi and @calebcartwright and they are on board.

@Manishearth Manishearth force-pushed the rustfmt-contributors branch from 0c8e951 to cbca9ef Compare October 8, 2025 17:57
@Kobzol
Copy link
Member

Kobzol commented Oct 8, 2025

I wonder if @ding-young might be interested in contributing to rustfmt again, or doing code reviews?

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Dry-run check results

[WARN  sync_team] sync-team is running in dry mode, no changes will be applied.
[INFO  sync_team] synchronizing github
[INFO  sync_team] 💻 Team Diffs:
    📝 Editing team 'rust-lang/all':
      Adding member 'camsteffen' with member role
    ➕ Creating team:
      Org: rust-lang
      Name: rustfmt-contributors
      Description: Managed by the rust-lang/team repository.
      Privacy: closed
      Members:
        Manishearth: member
        camsteffen: member
        fee1-dead: member
        jieyouxu: member
    💻 Repo Diffs:
    📝 Editing repo 'rust-lang/rustfmt':
      Permission Changes:
        Giving team 'rustfmt-contributors' write permission

@Manishearth
Copy link
Member Author

Based on a comment from Caleb in chat I added @camsteffen and @jieyouxu as well.

@anistark
Copy link

anistark commented Oct 8, 2025

@Manishearth Would be happy to contribute as well if needed more folks. 👋🏼

@Manishearth
Copy link
Member Author

Thanks! I am currently going to include people who have a history of being involved/interested in rustfmt and a history of working on the compiler or devtools, since it will be easy to get aligned on project .

At the moment we haven't really taken stock of the full situation so I can't say for sure what would help right now. By and large, we need help with review, and help with triage.

I recommend joining the zulip channel and participating in the discussions. I'll soon start up a discussion about dealing with the open PRs: if we can figure out a way to categorize them and get some merged that would be great.

@traviscross
Copy link
Contributor

This has an approval by the lead of the parent team. It's OK to merge.

cc @rust-lang/team-repo-admins

@jieyouxu jieyouxu added needs-team-repo-admin-review This change requires one of the `team-repo-admins` to review. S-waiting-on-review Status: waiting on review from a team/WG/PG lead, an infra-admin, and/or a team-repo-admin. labels Oct 9, 2025
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Approved by parent team lead, and discussed in council thread.

@jieyouxu jieyouxu added this pull request to the merge queue Oct 9, 2025
@ding-young
Copy link

ding-young commented Oct 9, 2025

I wonder if @ding-young might be interested in contributing to rustfmt again, or doing code reviews?

Sure, would you add me as well? I'll follow the discussions on zulip.

@jieyouxu jieyouxu removed this pull request from the merge queue due to a manual request Oct 9, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Oct 9, 2025

I'll hold off of merging this in case you and @calebcartwright want to add @ding-young to the initial members as well. We can also defer that to a new PR, let me know your preferences.

@jieyouxu
Copy link
Member

jieyouxu commented Oct 9, 2025

Actually, I'll merge this for now, we can easily add additional members in follow-ups.

@jieyouxu jieyouxu added this pull request to the merge queue Oct 9, 2025
Merged via the queue into rust-lang:master with commit bcd43d6 Oct 9, 2025
3 checks passed
@Manishearth Manishearth deleted the rustfmt-contributors branch October 9, 2025 01:46

[website]
name = "Rustfmt contributors"
description = "Helping the rustdoc team with reviews and planning."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description = "Helping the rustdoc team with reviews and planning."
description = "Helping the rustfmt team with reviews and planning."

Copy link
Member

Choose a reason for hiding this comment

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

Fixed in #2018

intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Oct 10, 2025
`rustfmt`, by default, formats imports in a way that is prone to conflicts
while merging and rebasing, since in some cases it condenses several
items into the same line.

For instance, Linus mentioned [1] that the following case:

    use crate::{
        fmt,
        page::AsPageIter,
    };

is compressed by `rustfmt` into:

    use crate::{fmt, page::AsPageIter};

which is undesirable.

Similarly, `rustfmt` may put several items in the same line even if the
braces span already multiple lines, e.g.:

    use kernel::{
        acpi, c_str,
        device::{property, Core},
        of, platform,
    };

The options that control the formatting behavior around imports are
generally unstable, and `rustfmt` releases do not allow to use nightly
features, unlike the compiler and other Rust tooling [2].

For the moment, we can introduce a workaround to prevent `rustfmt`
from compressing the example above -- the "trailing empty comment":

    use crate::{
        fmt,
        page::AsPageIter, //
    };

which is reminiscent of the trailing comma behavior in other formatters.
We already used empty comments for formatting purposes in the past,
e.g. in commit b9b701f ("rust: clarify the language unstable features
in use").

In addition, `rustfmt` actually reformats with a vertical layout (i.e. it
does not put two items in the same line) when seeing such a comment,
i.e. it doesn't just preserve the formatting, which is good in the sense
that we can use it to easily reformat some imports, since it matches
the style we generally want to have.

A Git merge driver would help (suggested by Gary and Wedson), though
maintainers would need to set it up, the diffs would still be larger
and the formatting rules for imports would remain hard to predict.

Thus document the style that we will follow in the coding guidelines
by introducing a new section and explain how the trailing empty comment
works there too.

We discussed the issue with upstream Rust in our usual Rust <-> Rust
for Linux meeting [3], and there have also been a few other discussions
in parallel in issues [4][5] and Zulip [6]. We will see what happens,
but upstream Rust has already created a subteam of `rustfmt` to try
to overcome the bandwidth issue [7], which is a good signal, and some
organization work has already started (e.g. tracking issues). We will
continue our discussions with them about it.

Cc: Caleb Cartwright <caleb.cartwright@outlook.com>
Cc: Yacin Tmimi <yacintmimi@gmail.com>
Cc: Manish Goregaokar <manishsmail@gmail.com>
Cc: Deadbeef <ent3rm4n@gmail.com>
Cc: Cameron Steffen <cam.steffen94@gmail.com>
Cc: Jieyou Xu <jieyouxu@outlook.com>
Link: https://lore.kernel.org/all/CAHk-=wgO7S_FZUSBbngG5vtejWOpzDfTTBkVvP3_yjJmFddbzA@mail.gmail.com/ [1]
Link: rust-lang/rustfmt#4884 [2]
Link: https://hackmd.io/iSCyY3JTTz-g8YM-nnzTTA [3]
Link: rust-lang/rustfmt#4991 [4]
Link: rust-lang/rustfmt#3361 [5]
Link: https://rust-lang.zulipchat.com/#narrow/channel/392734-council/topic/rustfmt.20maintenance/near/543815381 [6]
Link: rust-lang/team#2017 [7]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
ojeda added a commit to Rust-for-Linux/linux that referenced this pull request Oct 16, 2025
`rustfmt`, by default, formats imports in a way that is prone to conflicts
while merging and rebasing, since in some cases it condenses several
items into the same line.

For instance, Linus mentioned [1] that the following case:

    use crate::{
        fmt,
        page::AsPageIter,
    };

is compressed by `rustfmt` into:

    use crate::{fmt, page::AsPageIter};

which is undesirable.

Similarly, `rustfmt` may put several items in the same line even if the
braces span already multiple lines, e.g.:

    use kernel::{
        acpi, c_str,
        device::{property, Core},
        of, platform,
    };

The options that control the formatting behavior around imports are
generally unstable, and `rustfmt` releases do not allow to use nightly
features, unlike the compiler and other Rust tooling [2].

For the moment, we can introduce a workaround to prevent `rustfmt`
from compressing the example above -- the "trailing empty comment":

    use crate::{
        fmt,
        page::AsPageIter, //
    };

which is reminiscent of the trailing comma behavior in other formatters.
We already used empty comments for formatting purposes in the past,
e.g. in commit b9b701f ("rust: clarify the language unstable features
in use").

In addition, `rustfmt` actually reformats with a vertical layout (i.e. it
does not put two items in the same line) when seeing such a comment,
i.e. it doesn't just preserve the formatting, which is good in the sense
that we can use it to easily reformat some imports, since it matches
the style we generally want to have.

A Git merge driver would help (suggested by Gary and Wedson), though
maintainers would need to set it up, the diffs would still be larger
and the formatting rules for imports would remain hard to predict.

Thus document the style that we will follow in the coding guidelines
by introducing a new section and explain how the trailing empty comment
works there too.

We discussed the issue with upstream Rust in our usual Rust <-> Rust
for Linux meeting [3], and there have also been a few other discussions
in parallel in issues [4][5] and Zulip [6]. We will see what happens,
but upstream Rust has already created a subteam of `rustfmt` to try
to overcome the bandwidth issue [7], which is a good signal, and some
organization work has already started (e.g. tracking issues). We will
continue our discussions with them about it.

Cc: Caleb Cartwright <caleb.cartwright@outlook.com>
Cc: Yacin Tmimi <yacintmimi@gmail.com>
Cc: Manish Goregaokar <manishsmail@gmail.com>
Cc: Deadbeef <ent3rm4n@gmail.com>
Cc: Cameron Steffen <cam.steffen94@gmail.com>
Cc: Jieyou Xu <jieyouxu@outlook.com>
Link: https://lore.kernel.org/all/CAHk-=wgO7S_FZUSBbngG5vtejWOpzDfTTBkVvP3_yjJmFddbzA@mail.gmail.com/ [1]
Link: rust-lang/rustfmt#4884 [2]
Link: https://hackmd.io/iSCyY3JTTz-g8YM-nnzTTA [3]
Link: rust-lang/rustfmt#4991 [4]
Link: rust-lang/rustfmt#3361 [5]
Link: https://rust-lang.zulipchat.com/#narrow/channel/392734-council/topic/rustfmt.20maintenance/near/543815381 [6]
Link: rust-lang/team#2017 [7]
Reviewed-by: Benno Lossin <lossin@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-team-repo-admin-review This change requires one of the `team-repo-admins` to review. S-waiting-on-review Status: waiting on review from a team/WG/PG lead, an infra-admin, and/or a team-repo-admin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants