Run all rust code through rustfmt#143
Conversation
I've set up my Vim to run rustfmt whenever I save a file. It helps give all of our code a consistent style which I think makes work easier. But whenever I changed an old file, I would end up with a bunch of commit noise. My commit might be changing a single test, but every line of the file would get tweaked by rustfmt. So I'm rustfmting everything to get us to a common baseline. Still have to figure out how to make all future code use rustfmt.
|
I don't see anything controversial, but I'm open to any feedback before merging. |
| GotInvalid, // chain returned None | ||
| Correct, | ||
| ChainingFailure(Vec<Domino>), // failure to match the dots at the right side of one domino with | ||
| ChainingFailure(Vec<Domino>), /* failure to match the dots at the right side of one domino with */ |
There was a problem hiding this comment.
this one's a little weird, since the comment spans two line and now one line has /* */ and the next has //. I wonder why rustfmt didn't apply the same change to line 14.
There was a problem hiding this comment.
To make clear, I would not hold up the PR over this specific change, but am curious to know why it happened
There was a problem hiding this comment.
The answer is probably somewhere in here: https://github.com/rust-lang-nursery/rustfmt/blob/master/src/comment.rs
But I haven't spotted it.
I'm going to update this with a change that should be easier to read and won't be changed by rustfmt.
|
nice, there are a few changes in here (nitpicky things like the presence or absence of spaces or trailing commas) that I've been wanting to see for a while now, good that they're getting done automatically! I have a few questions about places where specific placements of newlines really help to visualize the input better. as I mentioned in line comments, I don't like having to fight an automated tool by reverting its change every time; is there a way we can signal it that the newlines should stay for those cases? you may have to bear with me on that question since I've not used rustfmt before :x |
|
When I get a chance I want to see how/if rustfmt can be customized. Then maybe we can address some of the more problematic changes it made. |
|
I decided that I didn't want to fight all the cases where our current formatting was appropriate. Closing. |
I've set up my Vim to run rustfmt whenever I save a file. It helps give
all of our code a consistent style which I think makes work easier.
But whenever I changed an old file, I would end up with a bunch of
commit noise. My commit might be changing a single test, but every line
of the file would get tweaked by rustfmt.
So I'm rustfmting everything to get us to a common baseline.
Still have to figure out how to make all future code use rustfmt.