[llvm-bugs] [Bug 36919] New: [Formatter/ObjC] ObjC dict literals do not obey SpacesInContainerLiterals

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 27 07:57:55 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=36919

            Bug ID: 36919
           Summary: [Formatter/ObjC] ObjC dict literals do not obey
                    SpacesInContainerLiterals
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bhamiltoncx at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Running clang-format from r327805, Objective-C dictionary literals should
follow the same spacing rules as array literals, but they only apply spaces
around the colons, not after { and before }:

% echo '@[@"a", @"b", @"c"]' | clang-format -style '{SpacesInContainerLiterals:
true}'
@[ @"a", @"b", @"c" ]

% echo '@[@"a", @"b", @"c"]' | clang-format -style '{SpacesInContainerLiterals:
false}'
@[@"a", @"b", @"c"]

% echo '@{@"a": @"b", @"c": @"d"}' | clang-format -style
'{SpacesInContainerLiterals: true}'
@{@"a" : @"b", @"c" : @"d"}

% echo '@{@"a": @"b", @"c": @"d"}' | clang-format -style
'{SpacesInContainerLiterals: false}'
@{@"a": @"b", @"c": @"d"}

I would expect the third to be:

@{ @"a" : @"b", @"c" : @"d" }

or maybe:

@{ @"a": @"b", @"c": @"d" }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180327/b72c6521/attachment.html>


More information about the llvm-bugs mailing list