[clang] [clang-format] Preserve trailing NOLINTEND placement with SeparateDefinitionBlocks (PR #190741)

Jiaqi He via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 18 02:31:38 PDT 2026


================
@@ -291,6 +291,36 @@ TEST_F(DefinitionBlockSeparatorTest, Always) {
                "struct E {};",
                Style);
 
+  verifyFormat("// NOLINTBEGIN\n"
+               "int x = 1;\n"
+               "int y = 2;\n"
+               "// NOLINTEND\n"
+               "\n"
+               "void some_function() {}\n",
+               Style,
+               "// NOLINTBEGIN\n"
+               "int x = 1;\n"
+               "int y = 2;\n"
+               "// NOLINTEND\n"
+               "\n"
+               "void some_function() {}\n",
+               false);
----------------
heturing wrote:

Noted. I have removed the newlines.

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


More information about the cfe-commits mailing list