[clang] [clang-format] Separate License text and include blocks (PR #77918)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 11:47:38 PST 2024


================
@@ -26846,6 +26846,26 @@ TEST_F(FormatTest, BreakAdjacentStringLiterals) {
   Style.BreakAdjacentStringLiterals = false;
   verifyFormat(Code, Style);
 }
+
+TEST_F(FormatTest, EmptyLinesAfterInclude) {
+  auto Style = getLLVMStyle();
+  Style.EmptyLinesAfterIncludes = 2;
+  Style.MaxEmptyLinesToKeep = 2;
+  verifyFormat("#include <string>\n\n\n"
+               "class Test {};",
----------------
HazardyKnusperkeks wrote:

```suggestion
  verifyFormat("#include <string>\n"
  "\n"
  "\n"
               "class Test {};",
```
So one does see the new lines directly.

https://github.com/llvm/llvm-project/pull/77918


More information about the cfe-commits mailing list