Hi,
I have the following two code styles in my codebase.
Style 1
if (!fun1(param)
&& fun2((type*)f, param) == FALSE)
continue;
Style 2
if ((v0 == n0 || v0 == n1 || v0 == n2) &&
(v1 == n0 || v1 == n1 || v1 == n2))
{
return out;
}
The problem I am seeing is that running clangformat does not make the 2 styles above consistent. If I use BreakBeforeBinaryOperators = None, then Style 1 is modified and Style 2 remains unchanged. With BreakBeforeBinaryOperators = NonAssignment or BreakBeforeBinaryOperators = All, Style 1 is retained Style 2 is modified.
Is there a way to make the 2 styles consistent? Or perhaps not modify either?
I use ColumnLimit : 0
and AlignOperands: Align
. I’m on clang format 16