In clang-format-12, KeepEmptyLinesAtTheStartOfBlocks: false removes the empty space at the top of a namespace. Starting with clang-format-13 (including 14, 15, 16) this option is no longer effective:
$ cat test.cpp
namespace {
int i = 0;
}
$ cat .clang-format
---
BasedOnStyle: Microsoft
KeepEmptyLinesAtTheStartOfBlocks: false
---
$ clang-format-12 -style=file ./test.cpp
namespace
{
int i = 0;
}
$ clang-format-13 -style=file ./test.cpp
namespace
{
int i = 0;
}
$ clang-format-14 -style=file ./test.cpp
namespace
{
int i = 0;
}
$ clang-format-15 -style=file ./test.cpp
namespace
{
int i = 0;
}
$ clang-format-16 -style=file ./test.cpp
namespace
{
int i = 0;
}
In clang-format-12,
KeepEmptyLinesAtTheStartOfBlocks: false
removes the empty space at the top of a namespace. Starting with clang-format-13 (including 14, 15, 16) this option is no longer effective: