Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-8174

clang-format incorrectly indents aggregate initializations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Aggregate initializations are incorrectly indented. I would expect the following indention,

      Foo bar{
          123,
          456,
          789};
      

      Instead this is indented as

      Foo bar{123,
              456,
              789};
      

      Forcing a line break after the opening curly incorrectly indents the arguments with two instead of four spaces,

      Foo bar{
      
        123,
        456,
        789};
      

      The Google C++ style guide suggests to

      Format a braced initializer list exactly like you would format a function call in its place.

      and our style guide demands

      Newline when calling or defining a function: indent with four spaces.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bbannier Benjamin Bannier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: