Merge bitcoin/bitcoin#33896: clang-format: Set InsertNewlineAtEOF: true

fa1bf6818f clang-format: Set InsertNewlineAtEOF: true (MarcoFalke)

Pull request description:

  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:

  ```
  truncate --size=-1 src/init.cpp
  git diff

  # Should fail:
  cargo run --manifest-path ./test/lint/test_runner/Cargo.toml -- --lint=trailing_newline

  # Restore newline:
  git diff -U0 | ./contrib/devtools/clang-format-diff.py -p1 -i -v
  ```

ACKs for top commit:
  l0rinc:
    ACK fa1bf6818f
  achow101:
    ACK fa1bf6818f
  hodlinator:
    ACK fa1bf6818f
  stickies-v:
    ACK fa1bf6818f
  hebasto:
    ACK fa1bf6818f.
  janb84:
    ACK fa1bf6818f

Tree-SHA512: 6443f0f9e2710fb31c85e4ece5deb9fa25bf22ef2d5cadad2d54a239194860c3a785ffa5dd97be942e42139336575425499f085aa2e3f29003e529fdc20fce20
This commit is contained in:
Ava Chow
2025-11-19 16:23:07 -08:00

View File

@@ -123,7 +123,7 @@ IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: false
InsertNewlineAtEOF: true
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0