-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Improve formatting #16113
Improve formatting #16113
Conversation
I would prefer this to be blocked until after the 0.15 is released, as it has high chances of conflicts during cherry picks. |
This turns lines that were already above 100 to be even longer. I don't see this as a win at all. Especially the one with long strings that put all the parameters on the same already way too long line. I'm pretty sure a bunch of those are bugs in rustfmt where it just gives up when lines are super long because of a string. |
Objective
Format the code optimally. This helps avoid conflicts and unnecessary changes.
For example, when trying to use Find & Replace to make code changes, formatting everything on 1 line makes it simpler. After the Find & Replace operations, formatting can be returned back to normal. This is what I did in #16112.
Solution
rustfmt.toml
setmax_width = 9999
.cargo fmt --all
.max_width
. (sets it back to100
)cargo fmt --all
.I consider this to be a workaround to a bug in rustfmt where the resulting formatted code depends on how it was formatted beforehand.
Testing
CI