From 4befe7ea3fb8cd5bf3f465759e9110873cdd586c Mon Sep 17 00:00:00 2001 From: constantintin Date: Thu, 27 Aug 2026 08:51:48 +0200 Subject: [PATCH 1/2] Wrap conditions after-first Co-Authored-By: Claude Opus 5 (1M context) --- .swiftformat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.swiftformat b/.swiftformat index 01c4735..c05b87e 100644 --- a/.swiftformat +++ b/.swiftformat @@ -32,7 +32,7 @@ --varattributes same-line --wraparguments after-first --wrapcollections before-first ---wrapconditions before-first +--wrapconditions after-first --wrapenumcases always --wrapparameters after-first --wrapreturntype preserve From dfea31d3feea71989e30073bbee33c3295fdce53 Mon Sep 17 00:00:00 2001 From: constantintin Date: Thu, 27 Aug 2026 09:07:49 +0200 Subject: [PATCH 2/2] Regenerate ObjC test fixtures to match the current clang-format config test.sh has been failing since cba5551 ("Merge remote-tracking branch 'square/master'"), which swapped the clang-format binary from 19.1.4 to the 21.0.0git 60b43ef build, rewrote a number of .clang-format settings, and added new custom pre/post processors -- but left the expected-output fixtures alone. Every difference is explained by an intentional change in that commit: SortIncludes false -> true, IncludeBlocks: Merge reordered imports BraceWrapping.AfterObjCDeclaration true -> false dropped blank lines ObjCSpaceAfterProperty: true removed @property (x) -> @property(x) SpacesInContainerLiterals true -> false @[ x ] -> @[x], @"k" : v -> @"k": v AllowShortFunctionsOnASingleLine All -> None inline ctor bodies split AlignTrailingComments true -> false macro continuation alignment new custom/RemoveVoidBlockDeclaration.py ^(void) { -> ^{ The config is the correct side here, not the fixtures: Fantastical's committed Objective-C already uses the new container-literal style by a wide margin (@[x] 1932 occurrences vs @[ x ] 2). Regenerated FormattedExample.m and UnicodeFormattedExample.m from format-objc-file-dry-run.sh. The other four cases already passed. Full suite, including the idempotence and in-place checks, now passes. Co-Authored-By: Claude Opus 5 (1M context) --- Testing Support/FormattedExample.m | 58 +++++++++++------------ Testing Support/UnicodeFormattedExample.m | 4 +- 2 files changed, 29 insertions(+), 33 deletions(-) diff --git a/Testing Support/FormattedExample.m b/Testing Support/FormattedExample.m index 0aad555..6370e31 100644 --- a/Testing Support/FormattedExample.m +++ b/Testing Support/FormattedExample.m @@ -1,6 +1,6 @@ // Copyright 2015 Square, Inc -#import @"XYZGeometry.h" #import "Blah.h" +#import @"XYZGeometry.h" #import @import FooFramework; @import FooFramework.SubModule; @@ -54,32 +54,29 @@ BOOL extraSemicolonsNotInsertedAfterCGStructInitializer() width:hairline]; } - @interface NSDictionary <__covariant KeyType, __covariant ObjectType>(INSScrub) -@property (nonatomic, assign, getter=isWackSpacingGetter, readonly) BOOL wackSpacing; -@property (readonly, copy) NSDictionary *ins_scrubbed; -@property (nonatomic, assign, getter=isWackSpacingGetter, readonly) BOOL wackSpacing; +@property(nonatomic, assign, getter=isWackSpacingGetter, readonly) BOOL wackSpacing; +@property(readonly, copy) NSDictionary *ins_scrubbed; +@property(nonatomic, assign, getter=isWackSpacingGetter, readonly) BOOL wackSpacing; @end - @interface NSDictionary <__covariant KeyType, __covariant ObjectType>(INSScrub) -@property (readonly, copy) NSDictionary *ins_scrubbedA; -@property (readonly, copy) NSDictionary *ins_scrubbedB; +@property(readonly, copy) NSDictionary *ins_scrubbedA; +@property(readonly, copy) NSDictionary *ins_scrubbedB; @end #define RKTAddTestCaseCategoryInterface(klass, name) \ @class klass; \ @interface KIFTestCase (klass##_ConvenienceAdditions) \ - @property (nonatomic, readonly, strong) klass *name; \ + @property(nonatomic, readonly, strong) klass *name; \ @end - @interface ProblemChild -@property (nonatomic, assign, getter=isWackSpacingGetter, readonly) BOOL wackSpacing; +@property(nonatomic, assign, getter=isWackSpacingGetter, readonly) BOOL wackSpacing; - (void)performOnMainThreadUsingBlock:(dispatch_block_t)block SQ_DEPRECATED("Should use addOperationWithBlock: on NSOperationQueue's mainQueue. Will be removed after 3/1/2015."); @end @@ -93,8 +90,10 @@ @interface Foo struct Update { UpdateType type; string value; - Update() : type(UPDATE_WRITE), value("") {} - Update(UpdateType t, const Slice &v) : type(t), value(v.data(), v.size()) {} + Update() : type(UPDATE_WRITE), value("") + {} + Update(UpdateType t, const Slice &v) : type(t), value(v.data(), v.size()) + {} }; /* Same deal here, don't mess with adding newlines after this comment block @@ -103,7 +102,6 @@ @interface Foo @implementation Foo @end - @implementation ProblemChild - (void)methodWithParams:(NSString *)param1 another:(BOOL)param2 @@ -114,8 +112,8 @@ - (void)methodWithParams:(NSString *)param1 another:(BOOL)param2 SQTypedKeyPath(MQItemControl, enabled), SQTypedKeyPath(MQItemControl, selected) ]]; - NSArray *testLiteral = @[ cool ]; - NSDictionary *dictLiteral = @{@"foo" : testLiteral}; + NSArray *testLiteral = @[cool]; + NSDictionary *dictLiteral = @{@"foo": testLiteral}; SQCheckCondition(NO, , @"Will the commas stay together?"); } @@ -146,14 +144,14 @@ - (BOOL)methodThatReturnsSomething - (void)blockFormat; { - [self block:^(void) { + [self block:^{ doStuff(); - } completionHandler:^(void) { + } completionHandler:^{ doStuff(); - [self block:^(void) { + [self block:^{ doStuff(); - } completionHandler:^(void) { + } completionHandler:^{ doStuff(); }]; }]; @@ -195,14 +193,14 @@ - (void)dictsInArray { NSArray *dictionaries = @[ @{ - @"token" : @"aaa", - @"first_name" : @"Alice", - @"last_name" : @"Adams" + @"token": @"aaa", + @"first_name": @"Alice", + @"last_name": @"Adams" }, @{ - @"token" : @"bbb", - @"first_name" : @"Betty", - @"last_name" : @"Brant" + @"token": @"bbb", + @"first_name": @"Betty", + @"last_name": @"Brant" } ]; } @@ -224,10 +222,10 @@ INSAFSuccessBlock INSAPIClientModelSuccessHandler(Class mantleClass, NSString *_ - (void)fetchWithSuccess:(nullable dispatch_block_t)success failure:(nullable INSHTTPFailure)failure { [self GET:@"data" parameters:nil success:INSAPIClientModelArraySuccessChain([INSModel class], nil, ^(INSModel *model, id responseObject) { - if (success) { - success(); - } - }, failure) failure:failure]; + if (success) { + success(); + } + }, failure) failure:failure]; } - (void)postWithSuccess:(nullable INSHTTPSuccess)success failure:(nullable INSHTTPFailure)failure diff --git a/Testing Support/UnicodeFormattedExample.m b/Testing Support/UnicodeFormattedExample.m index 4a1b575..5104ed4 100644 --- a/Testing Support/UnicodeFormattedExample.m +++ b/Testing Support/UnicodeFormattedExample.m @@ -6,18 +6,16 @@ // Copyright © 2017 Square, Inc. All rights reserved. // - @interface Foo @end - @implementation Foo - (void)hi { IM_A_MACRO(); id literal = @{ - @"😅" : @"😭", + @"😅": @"😭", }; } @end