[clang] [clang-format] Add KeepEmptyLines.AtEndOfBlock option (PR #224223)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 28 14:04:54 PDT 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results
* 3363 tests passed
* 33 tests skipped
All executed tests passed, but another part of the build **failed**. Click on a failure below to see the details.
<details>
<summary>[code=1] tools/clang/lib/Format/check_format_depend_0 C:/_work/llvm-project/llvm-project/build/tools/clang/lib/Format/check_format_depend_0</summary>
```
FAILED: [code=1] tools/clang/lib/Format/check_format_depend_0 C:/_work/llvm-project/llvm-project/build/tools/clang/lib/Format/check_format_depend_0
C:\Windows\system32\cmd.exe /C "cd /D C:\_work\llvm-project\llvm-project\build\tools\clang\lib\Format && C:\_work\llvm-project\llvm-project\build\bin\clang-format.exe C:/_work/llvm-project/llvm-project/clang/include/clang/Format/Format.h | "C:\Program Files\Git\usr\bin\diff.exe" -u C:/_work/llvm-project/llvm-project/clang/include/clang/Format/Format.h - && "C:\Program Files\Git\usr\bin\touch.exe" check_format_depend_0"
--- C:/_work/llvm-project/llvm-project/clang/include/clang/Format/Format.h 2026-09-28 19:53:01.648591000 +0000
+++ - 2026-09-28 20:15:57.342220200 +0000
@@ -3774,8 +3774,7 @@
/// Keep empty lines at start of file.
bool AtStartOfFile;
bool operator==(const KeepEmptyLinesStyle &R) const {
- return AtEndOfBlock == R.AtEndOfBlock &&
- AtEndOfFile == R.AtEndOfFile &&
+ return AtEndOfBlock == R.AtEndOfBlock && AtEndOfFile == R.AtEndOfFile &&
AtStartOfBlock == R.AtStartOfBlock &&
AtStartOfFile == R.AtStartOfFile;
}
```
</details>
<details>
<summary>[code=1] tools/clang/lib/Format/check_format_depend_40 C:/_work/llvm-project/llvm-project/build/tools/clang/lib/Format/check_format_depend_40</summary>
```
FAILED: [code=1] tools/clang/lib/Format/check_format_depend_40 C:/_work/llvm-project/llvm-project/build/tools/clang/lib/Format/check_format_depend_40
C:\Windows\system32\cmd.exe /C "cd /D C:\_work\llvm-project\llvm-project\build\tools\clang\lib\Format && C:\_work\llvm-project\llvm-project\build\bin\clang-format.exe C:/_work/llvm-project/llvm-project/clang/lib/Format/UnwrappedLineFormatter.cpp | "C:\Program Files\Git\usr\bin\diff.exe" -u C:/_work/llvm-project/llvm-project/clang/lib/Format/UnwrappedLineFormatter.cpp - && "C:\Program Files\Git\usr\bin\touch.exe" check_format_depend_40"
--- C:/_work/llvm-project/llvm-project/clang/lib/Format/UnwrappedLineFormatter.cpp 2026-09-28 19:53:02.283461100 +0000
+++ - 2026-09-28 20:15:58.085610400 +0000
@@ -1657,8 +1657,7 @@
(!RootToken.Next ||
(RootToken.Next->is(tok::semi) && !RootToken.Next->Next)) &&
// Do not remove empty lines before namespace closing "}".
- !getNamespaceToken(&Line, Lines) &&
- !Style.KeepEmptyLines.AtEndOfBlock) {
+ !getNamespaceToken(&Line, Lines) && !Style.KeepEmptyLines.AtEndOfBlock) {
Newlines = std::min(Newlines, 1u);
}
// Remove empty lines at the start of nested blocks (lambdas/arrow functions)
```
</details>
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.
https://github.com/llvm/llvm-project/pull/224223
More information about the cfe-commits
mailing list