Hi,
I have set up clang-format using “BreakBeforeBraces: Stroustrup”, this formats if
statements as follows:
if (str == “some string”) {
process(str);
str = “update str”;
}
This is great, it’s the coding convention we use in our C++ code base. However in
our code base we allow the opening brace to be on a new line for multi-line if
statements because this improves the code readability:
if (str1 == “some string” ||
str2 == “some string” ||
str3 == “some string”)
{
process(str);
str = “update str”;
}
Is there a way to configure clang-format so that it accepts the “new line before
opening brace” for multi-line if statements (while still using “no new line before
opening brace” by default)?