[SERVER-19396] Clang-format of struct initializers Created: 14/Jul/15  Updated: 15/Oct/19  Resolved: 15/Oct/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Martin Bligh Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Won't Fix Votes: 0
Labels: clang-format
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

changes this:

            *stone = {
                      .lastRecord = oplogEstimates[sampleIndex],
                      .bytes = minBytesPerStone,
                      .records = recordsPerSlot
             };

to this:

            *stone = {.lastRecord = oplogEstimates[sampleIndex],
                      .bytes = minBytesPerStone,
                      .records = recordsPerSlot};

which seems inconsistent and undesirable



 Comments   
Comment by Mark Benvenuto [ 03/May/16 ]

Since this cannot be done with clang-format 3.8.0, moving it to planned but not scheduled.

Comment by Mark Benvenuto [ 25/Apr/16 ]

Formatting of braced initializers is partially controlled by Cpp11BracedListStyle which is currently set to true. If it is set to false, here is the output:

    *stone = {.lastRecord = oplogEstimates[sampleIndex],
        .bytes = minBytesPerStone,
        .records = recordsPerSlot };

I do not know a way to match the expected style with clang-format 3.8.

Generated at Thu Feb 08 03:50:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.