[clang] [clang-format] extend clang-format directive with options to prevent formatting for one line (PR #118566)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 30 14:43:58 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 70c9152f99818ffd0342260ae12d709268031235 2215fe06429f4d7238eb9b778ad33cefdb9a7b89 --extensions cpp,h -- clang/include/clang/Format/Format.h clang/lib/Format/DefinitionBlockSeparator.cpp clang/lib/Format/Format.cpp clang/lib/Format/FormatTokenLexer.cpp clang/lib/Format/FormatTokenLexer.h clang/lib/Format/IntegerLiteralSeparatorFixer.cpp clang/lib/Format/SortJavaScriptImports.cpp clang/lib/Format/TokenAnnotator.cpp clang/unittests/Format/FormatTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 9bf70a8ccb..185f4fbcb5 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -28320,7 +28320,7 @@ TEST_F(FormatTest, KeepFormFeed) {
"void f();",
Style);
}
-
+
TEST_F(FormatTest, DisableLine) {
verifyFormat("int a = 1; // clang-format off-line\n"
"int b = 1;",
``````````
</details>
https://github.com/llvm/llvm-project/pull/118566
More information about the cfe-commits
mailing list