Change the BraceWrappingFlags' AfterControlStatement from a bool to an enum with three values:
- "Never": This is the default, and does not do any brace wrapping after control statements.
- "MultiLine": This only wraps braces after multi-line control statements (this really only happens when a ColumnLimit is specified).
- "Always": This always wraps braces after control statements.
The first and last options are backwards-compatible with "false" and "true", respectively.
The new "MultiLine" option is useful for when a wrapped control statement's indentation matches the subsequent block's indentation. It makes it easier to see at a glance where the control statement ends and where the block's code begins. For example:
if ( foo && bar ) { baz(); }
vs.
if ( foo && bar ) { baz(); }
Short control statements (1 line) do not wrap the brace to the next line, e.g.
if (foo) { bar(); } else { baz(); }
This text cannot be generated by dump_format_style.py in clang/docs/tools from the Format.h
I think this is the first time we've seen an enum being used in a structure, as such dump_format_style doesn't support pulling the text in automatically.
The next person who runs dump_format_style could easily end up blowing away your documentation.