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

Add rustfmt toml #60520

Merged
merged 1 commit into from
May 4, 2019
Merged

Add rustfmt toml #60520

merged 1 commit into from
May 4, 2019

Conversation

matklad
Copy link
Member

@matklad matklad commented May 3, 2019

This commit adds an rustfmt.toml for using for new code.
Old code should continut to use old style, until we put automated
style checks in place.

See
https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732/81
for the reason why we deviate from the default formatting. The TL;DR
is that currently compiler uses a pretty condensed style of code, and
default settings both create a huge diff and inflate the number of
lines. use_small_heuristics=Max fixes that.

version=Two is required for bug-fixes, which technically can't be made
to the stable first version

cc @Centril: I guess adding config file with agreed-upon formatting doesn't hurt :-)

EDIT: Zullip discussion: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/x.2Epy.20fmt

This commit adds an rustfmt.toml for using for **new** code.
Old code should continut to use old style, until we put automated
style checks in place.

See
https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732/81
for the reason why we deviate from the default formatting. The TL;DR
is that currently compiler uses a pretty condensed style of code, and
default settings both create a huge diff and inflate the number of
lines. use_small_heuristics=Max fixes that.

version=Two is required for bug-fixes, which technically can't be made
to the stable first version
@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 3, 2019
@alexcrichton
Copy link
Member

I've not been following these discussions much myself, so I'll ...

r? @Centril

@rust-highfive rust-highfive assigned Centril and unassigned alexcrichton May 3, 2019
@Centril
Copy link
Contributor

Centril commented May 3, 2019

Based on the discussion on Zulip linked above... and note by @petrochenkov:

Setting use_small_heuristics = "Max" and using "rustfmt 2.0 mode" (enables breaking bugfixes) resolved all my concerns.

as well as note by @nikomatsakis:

Hmm. I feel somewhat strongly we should use the defaults. But I guess I would accept use_small_heuristics = Max, particularly if it means we get rustfmt :)

I'd be opposed to a growing set of tweaks though.

I believe this is a good first initial step towards a rustfmted repo.

As such:

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 3, 2019

📌 Commit ce39461 has been approved by Centril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 3, 2019
@rust-lang rust-lang deleted a comment from bors May 3, 2019
@rust-lang rust-lang deleted a comment from bors May 3, 2019
Centril added a commit to Centril/rust that referenced this pull request May 4, 2019
… r=Centril

Add rustfmt toml

This commit adds an rustfmt.toml for using for **new** code.
Old code should continut to use old style, until we put automated
style checks in place.

See
https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732/81
for the reason why we deviate from the default formatting. The TL;DR
is that currently compiler uses a pretty condensed style of code, and
default settings both create a huge diff and inflate the number of
lines. use_small_heuristics=Max fixes that.

version=Two is required for bug-fixes, which technically can't be made
to the stable first version

cc @Centril: I guess adding config file with agreed-upon formatting doesn't hurt :-)

EDIT: Zullip discussion: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/x.2Epy.20fmt
bors added a commit that referenced this pull request May 4, 2019
Rollup of 9 pull requests

Successful merges:

 - #60429 (Account for paths in incorrect pub qualifier help)
 - #60449 (Constrain all regions in the concrete type for an opaque type)
 - #60486 (Place related refactors)
 - #60513 (Remove -Z borrowck=compare flag)
 - #60516 (Remove TypeckMir)
 - #60517 (Reword casting message)
 - #60520 (Add rustfmt toml)
 - #60521 (Migrate tidy to rust 2018 edition)
 - #60527 (Fix async fn lowering ICE with APIT.)

Failed merges:

r? @ghost
@bors bors merged commit ce39461 into rust-lang:master May 4, 2019
@matklad matklad deleted the rustfmt-all-the-new-things branch July 9, 2019 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants