I’m new to clang-format and I’m trying to figure out why clang-format removes the newline just after “animals_1 =”. I thought BreakBeforeBraces: Allman would always break before baces.
I am using clang-format version 17.0.1
.clang-format file:
BracedInitializerIndentWidth: 2 BreakBeforeBraces: Allman TabWidth: 2 UseTab: Never
Input
typedef enum { pig, dog, cow } animals_t; std::map animals_1 = { {"pig", pig}, {"dog", dog}, {"cow", cow} };
Output:
typedef enum { pig, dog, cow } animals_t; std::map animals_1 = { {"pig", pig}, {"dog", dog}, {"cow", cow} };