-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
Description
Feel free to close this if this is already possible and I just failed to figure out how.
There doesn't appear to be a way to accomplish this with clang-format:
// Break before braces after class/struct/union:
struct Foo
{
int x;
};
// AND allow empty class/struct/union on a single line:
struct Foo {};If we set BraceWrapping: AfterStruct: true and BraceWrapping: SplitEmptyRecord: false, we instead get this:
struct Foo
{};My proposal would be to add a bool AllowEmptyRecordsOnASingleLine option that handles this case similarly to the AllowShortEnumsOnASingleLine option. If others think this would be an acceptable enhancement, I can look into implementing it myself, but I thought I'd request feedback before I put in the work.