With this .clang-format config file:
InsertNewlineAtEOF: 'true'
KeepEmptyLinesAtEOF: 'true'
If I create a file called foobar.cpp and write to it:
int foobar () {
return 0;
}
and then run 'clang-format foobar.cpp', the output is:
int foobar() { return 0;}
No newline character is being inserted at the end of the file.
LLVM version is 20.1.8