<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/67738>67738</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Feature request: ability to break after `(` / before `)` in control flow statements
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-format
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          emilyy-dev
      </td>
    </tr>
</table>

<pre>
    After searching the clang-format style options webpage, I found no option to break after an opening parenthesis or before a closing one in control flow statements (`if`/`for`/`while`/`do while`), I was hoping to be able to have a format like this
```c
for (
    someReallyLongInit;
 someReallyLongPredicate;
    someReallyLongStep
) {
  // ...
}

if (
    someReallyLongPredicate
) {
  // ...
}

// etc.
```
The closest setting I could find was `AlignAfterOpenBracket` with `BlockIndent`, but that only applies to function invocations, not control flow statements (the documentation does not mention anything about it being specific to function calls, it might be worth noting that).

This formatting setting is available in IntelliJ IDEs (which I have used, hence me hoping I could find it in clang-format!), under File | Settings | Editor | Code Style | [language] | Wrapping and Braces, it has separate settings for `for`/`if`/`while`/`do while` statements (and for Java also has one for the `try-with-resources` statement) allowing to "Do not wrap", "Wrap if long", "Chop down if long" and "Wrap always" which control the behaviour of the parentheses and also breaking on the init/cond/iter step in the case of `for`, or breaking on `&&`s and `||`s in an `if`/`while`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVU-P6jYQ_zTmMloUHAhw4LALD4mnSq36ntSz40yIu8aT2hMQ374aE3bZbbuHShHYM57_v5kxKbljQNyoxYta7CZm4I7iBk_OX69PDZ4nNTXXzXPLGCGhibZz4QjcIVhvwvGppXgyDImvHoF6dhQSXLDuzRGV3sIBWhpCA4FGLjBBHdG8gslKTQDqMYjW3kQM3GFyCShCjS1FBAPWUxI-BQQXwFLgSB5aTxdIbBhPGDiB0itVFa5VVaH0XlVFS_HtfOmcx7dbQ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