Skip to content

Commit b352aa3

Browse files
cortinicofacebook-github-bot
authored andcommitted
Do not opt-out fbsource/xplat/js/react-native-github/template from CLANGFORMAT
Summary: As we're adding C++ code, I'm enabling CLANGFORMAT inside the React Native template folder. Changelog: [Internal] Reviewed By: zertosh Differential Revision: D33238197 fbshipit-source-id: e60c849bc776e8ec130c3baba01490d431d39a67
1 parent 0a3ddce commit b352aa3

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

template/ios/HelloWorld/AppDelegate.mm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#if RCT_NEW_ARCH_ENABLED
1010
#import <React/CoreModulesPlugins.h>
1111
#import <React/RCTCxxBridgeDelegate.h>
12-
#import <ReactCommon/RCTTurboModuleManager.h>
1312
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
1413
#import <React/RCTSurfacePresenter.h>
1514
#import <React/RCTSurfacePresenterBridgeAdapter.h>
15+
#import <ReactCommon/RCTTurboModuleManager.h>
1616

1717
#import <react/config/ReactNativeConfig.h>
1818

@@ -44,9 +44,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4444
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"HelloWorld", nil);
4545

4646
if (@available(iOS 13.0, *)) {
47-
rootView.backgroundColor = [UIColor systemBackgroundColor];
47+
rootView.backgroundColor = [UIColor systemBackgroundColor];
4848
} else {
49-
rootView.backgroundColor = [UIColor whiteColor];
49+
rootView.backgroundColor = [UIColor whiteColor];
5050
}
5151

5252
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
@@ -92,7 +92,8 @@ - (Class)getModuleClassFromName:(const char *)name
9292
}
9393

9494
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
95-
initParams:(const facebook::react::ObjCTurboModule::InitParams &)params
95+
initParams:
96+
(const facebook::react::ObjCTurboModule::InitParams &)params
9697
{
9798
return nullptr;
9899
}

template/ios/HelloWorld/main.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
#import "AppDelegate.h"
44

5-
int main(int argc, char * argv[]) {
5+
int main(int argc, char *argv[])
6+
{
67
@autoreleasepool {
78
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
89
}

template/ios/HelloWorldTests/HelloWorldTests.m

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ @interface HelloWorldTests : XCTestCase
1313

1414
@implementation HelloWorldTests
1515

16-
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
16+
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
1717
{
1818
if (test(view)) {
1919
return YES;
@@ -34,23 +34,25 @@ - (void)testRendersWelcomeScreen
3434

3535
__block NSString *redboxError = nil;
3636
#ifdef DEBUG
37-
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
38-
if (level >= RCTLogLevelError) {
39-
redboxError = message;
40-
}
41-
});
37+
RCTSetLogFunction(
38+
^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
39+
if (level >= RCTLogLevelError) {
40+
redboxError = message;
41+
}
42+
});
4243
#endif
4344

4445
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
4546
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
4647
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
4748

48-
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
49-
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
50-
return YES;
51-
}
52-
return NO;
53-
}];
49+
foundElement = [self findSubviewInView:vc.view
50+
matching:^BOOL(UIView *view) {
51+
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
52+
return YES;
53+
}
54+
return NO;
55+
}];
5456
}
5557

5658
#ifdef DEBUG
@@ -61,5 +63,4 @@ - (void)testRendersWelcomeScreen
6163
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
6264
}
6365

64-
6566
@end

0 commit comments

Comments
 (0)