[PATCH] D101868: [clang-format] Adds a formatter for aligning arrays of structs

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 21 10:37:10 PDT 2021


MyDeveloperDay added inline comments.


================
Comment at: clang/unittests/Format/FormatTest.cpp:16389
+  for (const auto &Style : Styles) {
+    verifyFormat("struct test demo[] = {\n"
+                 "    {56, 23,    \"hello\" },\n"
----------------
may be worth testing a case with comments at the end of each line

```
verifyFormat("struct test demo[3] = {\n"
                 "    {56, 23,    \"hello\" }, // first line\n"
                 "    {-1, 93463, \"world\" }, /* second line */\n"
                 "    {7,  5,     \"!!\"    } // at the end\n"
                 "};\n",
                 Style);
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101868/new/

https://reviews.llvm.org/D101868



More information about the cfe-commits mailing list