[PATCH] D152305: [clang-format] Add the KeepEmptyLinesAtEOF option

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 6 13:32:08 PDT 2023


owenpan created this revision.
owenpan added a reviewer: klimek.
Herald added projects: All, clang, clang-format.
Herald added a subscriber: cfe-commits.
Herald added reviewers: rymiel, HazardyKnusperkeks, MyDeveloperDay.
owenpan requested review of this revision.

Adds an option `KeepEmptyLinesAtEOF` to keep empty lines (up to `MaxEmptyLinesToKeep`) before EOF. This remedies the probably unintentional change in behavior introduced in 3d3ea84a4f8fc, which started to always remove empty lines before EOF.

Fixes https://github.com/llvm/llvm-project/issues/56054 and https://github.com/llvm/llvm-project/issues/63150.


https://reviews.llvm.org/D152305

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/UnwrappedLineFormatter.cpp
  clang/unittests/Format/ConfigParseTest.cpp
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152305.529019.patch
Type: text/x-patch
Size: 5088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230606/e3cc88f4/attachment-0001.bin>


More information about the cfe-commits mailing list