clang-format aligning `+=`.

In this revision ⚙ D8821 clang-format: Add ability to align assignment operators, += is aligned along with = like the first block. But in the final version we have it not aligned like the second block. When did they decide that only = should be aligned?

sfdbddfbdfbb    ^= 5;
dvsdsv          |= 5;
int dsvvdvsdvvv = 123;

sfdbddfbdfbb ^= 5;
dvsdsv |= 5;
int dsvvdvsdvvv = 123;

Hi,
I have no real answer to your question but it seems that what was committed doesn’t correspond to the review.
You can see in the commit https://github.com/llvm/llvm-project/commit/a4499133b124cc3026c0ca33e7b8ead1b5c1d723 that tests were added that verify explicitly that other assignments (like +=) are not aligned.
I guess that it will be pretty straightforward to add these though. I’ll be happy to review if you feel like doing this!
Just note that we need to stay backward compatible and so add a new knob for this option.

I am trying to implement it. I don’t know what to do about this test:

  Alignment.ColumnLimit = 0;
  EXPECT_EQ("int    a(int   x,\n"
            "         float y);\n"
            "double b(int    x,\n"
            "         double y);",
            format("int a(int x,\n"
                   " float y);\n"
                   "double b(int x,\n"
                   " double y);",
                   Alignment));

It looks like ChangeMaxColumn in function AlignTokens wraps around 0. Once I fix it, the test fails.

The output:

-int    a(int   x,
-         float y);
-double b(int    x,
+int a(int x,
+      float y);
+double b(int x,
          double y);

It’s a bit hard to say anything without more context.
My advice is create a patch and upload it to phabricator, there we can do a proper review. Including help on such questions.