Does anyone know how to configure clang-format to keep enum's on individual lines?
i.e.
enum {
ONE,
TOW,
THREE
};
vs.
enum {ONE, TWO, THREE};
EDIT:
Here are the style options i use to match Apple's Objective-C style guide.
Does anyone know how to configure clang-format to keep enum's on individual lines?
i.e.
enum {
ONE,
TOW,
THREE
};
vs.
enum {ONE, TWO, THREE};
EDIT:
Here are the style options i use to match Apple's Objective-C style guide.
This was intentionally introduced at some stage (so if you are unable to reproduce the behavior, you are likely on an older version).
clang-format contracts enums to a single line if all elements fit on one line. This conserves spaces and usually does not decrease readability. There is no style option, but you can override this by either adding a line comment somewhere or by adding a trailing comma after the last enumerator, e.g.:
or
Per this answer, setting
ColumnLimit
to0
will also achieve this behaviour.