Skip to content
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

Formatting the rust-lang/rust codebase #133

Closed
dtolnay opened this issue Aug 22, 2018 · 2 comments
Closed

Formatting the rust-lang/rust codebase #133

dtolnay opened this issue Aug 22, 2018 · 2 comments

Comments

@dtolnay
Copy link
Member

dtolnay commented Aug 22, 2018

It seems clear that at some point we will want to programmatically format all of rust-lang/rust. I haven't found anything more than brief informal discussion of how to go about this, so I thought I would bring it up here. Please let me know if there is a better place to start this discussion or if the discussion has already happened somewhere.

Is it within scope for the style team or rustfmt team to make a proposal to the compiler team of how to make this happen, given all of your experience with rustfmt in all sorts of codebases, or is this something that you leave entirely up to the compiler team to sort out?

This is going to be a large enough effort with many stakeholders that it would be worthwhile putting together an RFC.

  • How to land the formatting changes? A single huge commit, separate commits by crate, ...
  • How to mitigate downsides? Every open PR and work in progress will hit merge conflicts; we will want clear guidance or even tooling to make the process smoother for PR authors. Any tooling we come up with could be helpful for adoption of rustfmt in other large Rust codebases too.
  • Timeline. Do we not even want to think about this until after rustfmt stability has been settled and 1.0 has shipped? Or do we do it sooner to get more eyes on the rustfmt style and increase our confidence prior to 1.0?

Some relevant mentions:
Formatting guidelines RFC
Rustfmt stability RFC
Rustfmt 1.0 tracking issue
@topecongiro @nrc

@nrc
Copy link
Member

nrc commented Aug 22, 2018

I think this would mostly be up to the compiler team. I don't think we have much experience to bring to this other than 'don't try to run rustfmt on CI before it is stable'.

I've chatted a little bit to @nikomatsakis and iirc we thought one big commit with lots of advanced warning and a closed tree would be the way to do it.

@dtolnay
Copy link
Member Author

dtolnay commented Aug 22, 2018

Sounds good. If the compiler team owns this then I'll trust it is on their radar and will happen when it makes sense. With one big commit I assume they'll take care of the standard library as well so there is no action needed from the libs team for now. Thanks :)

@dtolnay dtolnay closed this as completed Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants