[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 27 12:11:57 PDT 2024


================
@@ -493,9 +493,25 @@ TEST_F(FormatTestComments, AlignsBlockComments) {
 
 TEST_F(FormatTestComments, CommentReflowingCanBeTurnedOff) {
   FormatStyle Style = getLLVMStyleWithColumns(20);
-  Style.ReflowComments = false;
-  verifyFormat("// aaaaaaaaa aaaaaaaaaa aaaaaaaaaa", Style);
-  verifyFormat("/* aaaaaaaaa aaaaaaaaaa aaaaaaaaaa */", Style);
+  Style.ReflowComments = FormatStyle::RCS_Never;
+  verifyNoChange("// aaaaaaaaa aaaaaaaaaa aaaaaaaaaa", Style);
+  verifyNoChange("/* aaaaaaaaa aaaaaaaaaa aaaaaaaaaa */", Style);
+  verifyNoChange("/* aaaaaaaaa aaaaaaaaaa aaaaaaaaaa\naaaaaaaaa*/", Style);
----------------
HazardyKnusperkeks wrote:

```suggestion
  verifyNoChange("/* aaaaaaaaa aaaaaaaaaa aaaaaaaaaa\n"
                 "aaaaaaaaa*/", Style);
```
Same for the following.

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


More information about the cfe-commits mailing list