Avoid bin packing conditions inside if statement

Hi All,

I’m curious if anybody tried to implement an option for clang-format to prevent bin packing conditions inside if statements (or maybe it already exists and I missed it).

Here is an example,

% cat test.cpp
void func(int a,
double b,
bool c);
int main() {
func(123456,
1.23456,
false);
if(false ||
true ||
false) {
// stuff
}
return 0;
}

Formatting with default settings (except a column limit) produces the following:

% ./clang-format -style="{BasedOnStyle: LLVM, ColumnLimit: 27}" test.cpp
void func(int a, double b,
bool c);
int main() {
func(123456, 1.23456,
false);
if (false || true ||
false) {
// stuff
}
return 0;
}

It’s possible to prevent bin packing of function parameters and arguments:

% ./clang-format -style="{BasedOnStyle: LLVM, ColumnLimit: 27, BinPackParameters: false, BinPackArguments: false}" test.cpp
void func(int a,
double b,
bool c);
int main() {
func(123456,
1.23456,
false);
if (false || true ||
false) {
// stuff
}
return 0;
}

But nothing I can do about conditions inside the if statement. And I believe such an option would be quite useful as it provides the same readability benefits as BinPackParameters and BinPackArguments.

Thanks,
Mikhail