Skip to content

Running rustfmt on rust-lang/rust codebase #66688

Closed
@dtolnay

Description

@dtolnay

Filing this to track https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732 in a way that doesn't get locked every 90 days, since I believe we all still want this to happen.

Using rustfmt would have several wins:

  • Adopt a uniform style, of course
  • But also resolve problems that contributors have either:
    • trying to figure out our style (heh, good luck)
    • accidentally running rustfmt on stuff that drags in a lot of auxiliary diffs

There are obviously two main approaches:

  • Flag day
  • Gradual transition

I am partial to “flag day” myself, but I could go either way.

There is another question too: how to keep things formatted? In my ideal world, this would be fairly painless, but I’m not sure how best to achieve that (one idea I had was a rustfmtbot that runs rustfmt on people’s PRs and pushes commits automatically, but that does not exist afaik).

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions