-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Run rustfmt #1259
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 #1259
Conversation
And of course now #1246 is calling and there will be horrible merge conflicts I'm sure \o/ |
No conflict whatsoever, where is the fun git? |
span_lint_and_then(cx, USELESS_ATTRIBUTE, attr.span, | ||
span_lint_and_then(cx, | ||
USELESS_ATTRIBUTE, | ||
attr.span, | ||
"useless lint attribute", | ||
|db| { | ||
sugg.insert(1, '!'); |
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.
I actually like what rustfmt did with our closures. They look like this closure now.
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.
The thing is it did not format them all the same. Sometimes pushing the content to the left like here, sometimes pushing it to the right 😕
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.
try closure_block_indent_threshold = -1
or closure_block_indent_threshold = 99
"useless lint attribute", | ||
|db| { | ||
sugg.insert(1, '!'); | ||
db.span_suggestion(attr.span, "if you just forgot a `!`, use", sugg); | ||
}); | ||
} | ||
} | ||
}, |
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.
set match_block_trailing_comma = true
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.
I don't really have a strong opinion on that one. The default looks fine.
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.
I have a strong opinion :P I really like the fact that you can distinguish a match arm block closing bracket from other closing brackets, but I can do my own PR when I get around to it.
I reran rustfmt, there was a really degenerate case in one of our tests, but even I can't figure out how to format that properly, so I just slapped on a |
@oli-obk You realize this only runs rustfmt on |
whoops fixing I was wondering why I got so few hits |
😄 |
So I was going to integrate coverage tests in Travis, but @Manishearth was to fast.
So I though “Hey, what other tool could I fight against? Oh I know, it's been a long time since we haven't run
rustfmt
!”.rustfmt
decides what to do withmatch
arms and another one for all our|db| {}
lambdas.