Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
58 changes: 28 additions & 30 deletions Testing Support/FormattedExample.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2015 Square, Inc
#import @"XYZGeometry.h"
#import "Blah.h"
#import @"XYZGeometry.h"
#import <Great.h>
@import FooFramework;
@import FooFramework.SubModule;
Expand Down Expand Up @@ -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<KeyType, ObjectType> *ins_scrubbed;
@property (nonatomic, assign, getter=isWackSpacingGetter, readonly) BOOL wackSpacing;
@property(nonatomic, assign, getter=isWackSpacingGetter, readonly) BOOL wackSpacing;
@property(readonly, copy) NSDictionary<KeyType, ObjectType> *ins_scrubbed;
@property(nonatomic, assign, getter=isWackSpacingGetter, readonly) BOOL wackSpacing;

@end


@interface NSDictionary <__covariant KeyType, __covariant ObjectType>(INSScrub)

@property (readonly, copy) NSDictionary<KeyType, ObjectType> *ins_scrubbedA;
@property (readonly, copy) NSDictionary<KeyType, ObjectType> *ins_scrubbedB;
@property(readonly, copy) NSDictionary<KeyType, ObjectType> *ins_scrubbedA;
@property(readonly, copy) NSDictionary<KeyType, ObjectType> *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 <NeatInterface>
@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
Expand All @@ -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
Expand All @@ -103,7 +102,6 @@ @interface Foo
@implementation Foo
@end


@implementation ProblemChild

- (void)methodWithParams:(NSString *)param1 another:(BOOL)param2
Expand All @@ -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?");
}

Expand Down Expand Up @@ -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();
}];
}];
Expand Down Expand Up @@ -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"
}
];
}
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions Testing Support/UnicodeFormattedExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
// Copyright © 2017 Square, Inc. All rights reserved.
//


@interface Foo
@end


@implementation Foo
- (void)hi
{
IM_A_MACRO();

id literal = @{
@"😅" : @"😭",
@"😅": @"😭",
};
}
@end