Is there a way to tell clang-format
to keep empty lines at the end of blocks? Currently, our style guide is to have 1 empty line at the start of a multi-line block and 1 at the end. Setting KeepEmptyLinesAtTheStartOfBlocks
to true stops clang-format
from removing the initial empty line, but we haven’t found a way to stop it from removing the trailing newline. It is not an issue if clang-format
doesn’t automatically apply this style to code that doesn’t conform to the style guide, but we’d like to find a way to stop it from editing code that does match it. For reference, what we would like to have is a configuration that allows the following to be unchanged by clang-format
:
if (foo) {
bar();
baz();
}
Thanks!
Patrick