[PATCH] clang-format: Add ability to align assignment operators

Matt Oakes oakesm9 at gmail.com
Tue Apr 14 02:38:17 PDT 2015


@djasper Can you think of a solution for not aligning on default parameters and assignments in `for` loops? Could we check for all the keywords like `for` at the beginning of the line and ignore that line if one is found?


================
Comment at: unittests/Format/FormatTest.cpp:8363
@@ +8362,3 @@
+               "int oneTwoThree = 123;", Alignment);
+  EXPECT_EQ("int a           = 5;\n"
+            "int oneTwoThree = 123;",
----------------
djasper wrote:
> Is there a particular reason, not to use verifyFormat everywhere?
When I used it it seemed to remove some of the newlines between each "block" of statements, which was making the tests fail. I think it was something to do with the //mess up// function.

http://reviews.llvm.org/D8821

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list