Unverified Commit e16a8344 authored by Owen Pan's avatar Owen Pan Committed by GitHub
Browse files

[clang-format][NFC] Skip alignArrayInitializers() for 1-row matrices (#72166)

parent 797b68c0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ private:
    // Determine if every row in the array
    // has the same number of columns.
    bool isRectangular() const {
      if (CellCounts.empty())
      if (CellCounts.size() < 2)
        return false;

      for (auto NumberOfColumns : CellCounts)
+3 −1
Original line number Diff line number Diff line
@@ -20884,6 +20884,7 @@ TEST_F(FormatTest, CatchAlignArrayOfStructuresRightAlignment) {
               "};",
               Style);
  // TODO: Fix the indentations below when this option is fully functional.
#if 0
  verifyFormat("int a[][] = {\n"
               "    {\n"
               "     {0, 2}, //\n"
@@ -20891,6 +20892,7 @@ TEST_F(FormatTest, CatchAlignArrayOfStructuresRightAlignment) {
               "    }\n"
               "};",
               Style);
#endif
  Style.ColumnLimit = 100;
  verifyFormat(
      "test demo[] = {\n"