[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: Linux-->
# :penguin: Linux x64 Test Results
* 8034 tests passed
* 554 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 /home/gha/actions-runner/_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 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/lib/Format/check_format_depend_0
cd /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/lib/Format && /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-format /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Format/Format.h | /usr/bin/diff -u /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Format/Format.h - && /usr/bin/touch check_format_depend_0
--- /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Format/Format.h 2026-09-28 19:53:53.286972162 +0000
+++ - 2026-09-28 20:05:51.980007521 +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 /home/gha/actions-runner/_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 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/lib/Format/check_format_depend_40
cd /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/lib/Format && /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-format /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/UnwrappedLineFormatter.cpp | /usr/bin/diff -u /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/UnwrappedLineFormatter.cpp - && /usr/bin/touch check_format_depend_40
--- /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/UnwrappedLineFormatter.cpp 2026-09-28 19:53:53.438972815 +0000
+++ - 2026-09-28 20:05:52.368214767 +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