Run CLANGFORMAT on FlipperKit folder
Summary: This diff runs CLANGFORMAT lint on FlipperKit. I have added CLANGFORMAT as the lint engined for objc files in xplat/sonar. Right now the iOS folder is not formatted according to CLANGFORMAT. Ran `arc lint -a --paths-cmd "find ./iOS/FlipperKit -type f" --verbose` Reviewed By: passy Differential Revision: D19942170 fbshipit-source-id: af677323af4edb761f61f8f7e289cab743aa31f2
This commit is contained in:
committed by
Facebook Github Bot
parent
127eec5fa1
commit
ca513cf370
@@ -15,22 +15,28 @@ static int const DEFAULT_SECURE_PORT = 8088;
|
||||
@implementation SKEnvironmentVariables
|
||||
|
||||
+ (int)getInsecurePort {
|
||||
NSString *envVar = [self getFlipperPortsVariable];
|
||||
return [self extractIntFromPropValue:envVar atIndex:0 withDefault:DEFAULT_INSECURE_PORT];
|
||||
NSString* envVar = [self getFlipperPortsVariable];
|
||||
return [self extractIntFromPropValue:envVar
|
||||
atIndex:0
|
||||
withDefault:DEFAULT_INSECURE_PORT];
|
||||
}
|
||||
+ (int)getSecurePort {
|
||||
NSString *envVar = [self getFlipperPortsVariable];
|
||||
return [self extractIntFromPropValue:envVar atIndex:1 withDefault:DEFAULT_SECURE_PORT];
|
||||
NSString* envVar = [self getFlipperPortsVariable];
|
||||
return [self extractIntFromPropValue:envVar
|
||||
atIndex:1
|
||||
withDefault:DEFAULT_SECURE_PORT];
|
||||
}
|
||||
+ (int)extractIntFromPropValue:(NSString *)propValue atIndex:(int)index withDefault:(int)fallback {
|
||||
NSArray<NSString *> *components = [propValue componentsSeparatedByString:@","];
|
||||
NSString *component = [components objectAtIndex:index];
|
||||
int envInt = [component intValue];
|
||||
return envInt > 0 ? envInt : fallback;
|
||||
+ (int)extractIntFromPropValue:(NSString*)propValue
|
||||
atIndex:(int)index
|
||||
withDefault:(int)fallback {
|
||||
NSArray<NSString*>* components = [propValue componentsSeparatedByString:@","];
|
||||
NSString* component = [components objectAtIndex:index];
|
||||
int envInt = [component intValue];
|
||||
return envInt > 0 ? envInt : fallback;
|
||||
}
|
||||
+ (NSString *)getFlipperPortsVariable {
|
||||
NSString *value = NSProcessInfo.processInfo.environment[@"FLIPPER_PORTS"];
|
||||
return value;
|
||||
+ (NSString*)getFlipperPortsVariable {
|
||||
NSString* value = NSProcessInfo.processInfo.environment[@"FLIPPER_PORTS"];
|
||||
return value;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user