Issue 58125
Summary Feature request: bin packing boolean expressions, similar to BinPackArguments
Labels new issue
Assignees
Reporter 3geek14
    It's common to have several boolean operators all combined with `&&` or `||` that can't fit onto one line. As far as I can tell, it appears that there's no way to control how clang-format wraps the conditions. I would like something similar to BinPackArguments and BinPackParameters that I can toggle so that I can get code more like the following:

    public bool Equals(Thing other) {
      return PropA == other.PropA
          && PropB == other.PropB
          && VeryLongPropertyName == other.VeryLongPropertyName;
    }

    if (cond1
        || cond2
        || cond3
        || veryLongConditionName)

I saw `BreakBeforeBinaryOperators` and thought that might achieve this, but it appears to only affect whether line breaks are before/after operators *if clang-format already wants to break a line there*.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to