It would be nice if clang-format could maintain one equality check per line when there are multiple equality checks chained together with &&. At least if already formatted this way, otherwise not violating any other formatting rules and won't all fit on a single line.
The following example is from operator==() for a smallish struct. Having a single statement per line makes it easier to see what members are being compared, which in turn makes it easier to notice if something isn't being compared. It's similar to initializer lists which are formatted one member variable per line.
clang-format produced code that (choose all that apply):
[ ] Doesn't match Chromium style
[ ] Doesn't match blink style
[x] Riles my finely honed stylistic dander
[ ] No sane human would ever choose
Here's the code before formatting:
return display_id == other.display_id &&
parent_display_id == other.parent_display_id &&
position == other.position &&
offset == other.offset &&
offset_reference == other.offset_reference;
Here's the code after formatting:
return display_id == other.display_id &&
parent_display_id == other.parent_display_id &&
position == other.position && offset == other.offset &&
offset_reference == other.offset_reference;
Here's how it ought to look:
(same as before)
Code review link for full files/context:
https://codereview.chromium.org/2661663002/
Comment 1 by dtapu...@chromium.org
, Oct 26 2017