Open LiamPattinson opened 2 months ago
This is probably a "pedantic" warning rather than a default one!
I agree, but I've seen this sort of thing argued in C/C++ style guides, so I think it would make sense to have it as an option
I wrote something out arguing that it's different, but then I convinced myself it isn't really!
Maybe if the statement is split over multiple lines it's more dangerous than if it's all on one line. I'm not sure how easy that is to catch
I prefer the one-line if to the block and would therefore prefer that a warning about the one-line if not be turned on by default.
For consistency and readability, prefer this:
over this: