-
Notifications
You must be signed in to change notification settings - Fork 361
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
Run rustfmt #1118
Run rustfmt #1118
Conversation
This basically confirms what I thought about rustfmt: that a large fraction of the things it changes are somewhat questionable, and a smaller fraction outright makes things worse and needs manual clean-up. :/ |
But automatable :D I'm fine with a few things being odd
I think most of these I have been able to fix with the rustfmt.toml flag
Well, the situations I have manually fixed weren't ideal to begin with. I think some of them are now significantly better |
| "acos" | ||
| "asin" | ||
| "atan" | ||
=> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opinions on this style? I like it because it makes changing the list never cause fallout in unrelated elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all lines are consistent though, the first line is different. So the thing that would be most like how we format comma-separated lists would be to make every line "foo" |
. Unfortunately though, this does not compile.
So the version taht compiles would be to make every line | "foo"
, I guess? Including the first line, like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like that's what you got. So in the confines of the Rust grammar, I guess that is the best we'll get.
Shame that rustfmt destroys that. :/
Do you want to wait on merging this until the second rustfmt issue is solved or are the |
No, we don't have to wait for that. But we should probably land #1101 first due to conflicts. |
Also it would probably be best to exclude |
☔ The latest upstream changes (presumably #1101) made this pull request unmergeable. Please resolve the merge conflicts. |
_ => { | ||
throw_unsup_format!("The {} error cannot be transformed into a raw os error", e) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could set match_arm_blocks = false
to avoid things like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly this still gets a block, even with match_arm_blocks = false
? Any idea why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rustfmt bailed out further up in the ast here out of other reasons?
rustc's |
no clue about version = "Two", let's see what happens |
0c066fb
to
734fa6c
Compare
|
I'll squash and exclude |
Works for me. I'd still format some bits differently but those are nits. |
734fa6c
to
7ead530
Compare
@bors r+ |
📌 Commit 7ead530 has been approved by |
Run rustfmt This is `cargo +nightly fmt --all` with `rustc 1.41.0-nightly (c8ea4ace9 2019-12-14)`
next step, block CI on rustfmt? |
I feared you'd suggest this. :/ But that seems to be the way the Rust community is moving, even though I am not terribly happy about it TBH. I don't consider rustfmt "better" unambiguously enough. Maybe let's wait a bit how enforcing rustfmt works out for rustc itself? |
☀️ Test successful - checks-travis, status-appveyor |
I don't consider rustfmt better either. But it's just so convenient when I can turn it on on a project. I stop doing any kind of formatting myself. I press save or move the window focus and the file is formatted.
Fine by me. We can also leave it off for this repo since you dislike enforcing rustfmt on CI. It just means that sometimes we'll start getting unrelated changes if someone with rustfmt turned on edits something that was previously edited by someone who doesn't use rustfmt. An intermediate state would be to add CI trickery to automatically add a rustfmt commit before running bors |
This is
cargo +nightly fmt --all
withrustc 1.41.0-nightly (c8ea4ace9 2019-12-14)