I have the following BraceWrapping options:
BraceWrapping:
AfterEnum: false
AfterStruct: false
SplitEmptyFunction: false
AfterControlStatement: "Never"
AfterFunction: false
AfterNamespace: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
However, clang-format always inserts a new line after an enum:
enum class event_flags : std::uint8_t
{
running = 1 << 0,
executed = 1 << 1,
};
I want it to be like this:
enum class event_flags : std::uint8_t {
running = 1 << 0,
executed = 1 << 1,
};
what am I doing wrong here?
The one option I could find that seems to fix this formatting for you is outside the BraceWrapping section and that is setting
AllowShortEnumsOnASingleLine: true
even though the description of that option doesn't mention it:
true:
enum { A, B } myEnum;
false:
enum {
A,
B
} myEnum;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With