Now that the minimum supported clang version is 17, the InsertNewlineAtEOF setting can be set to true in the clang-format file. (https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormatStyleOptions.html#insertnewlineateof)
This is in line with the already existing newline linter. Can be tested via:
0truncate --size=-1 src/init.cpp
1git diff
2
3# Should fail:
4cargo run --manifest-path ./test/lint/test_runner/Cargo.toml -- --lint=trailing_newline
5
6# Restore newline:
7git diff -U0 | ./contrib/devtools/clang-format-diff.py -p1 -i -v