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
@@ -13,6 +13,7 @@ FlipperCppBridgingConnection is a simple ObjC wrapper around SonarConnection
|
||||
that forwards messages to the underlying C++ connection. This class allows
|
||||
pure Objective-C plugins to send messages to the underlying connection.
|
||||
*/
|
||||
@interface FlipperCppBridgingConnection : NSObject <FlipperConnection>
|
||||
- (instancetype)initWithCppConnection:(std::shared_ptr<facebook::flipper::FlipperConnection>)conn;
|
||||
@interface FlipperCppBridgingConnection : NSObject<FlipperConnection>
|
||||
- (instancetype)initWithCppConnection:
|
||||
(std::shared_ptr<facebook::flipper::FlipperConnection>)conn;
|
||||
@end
|
||||
|
||||
@@ -13,6 +13,7 @@ SonarCppBridgingResponder is a simple ObjC wrapper around FlipperResponder
|
||||
that forwards messages to the underlying C++ responder. This class allows
|
||||
pure Objective-C plugins to send messages to the underlying responder.
|
||||
*/
|
||||
@interface FlipperCppBridgingResponder : NSObject <FlipperResponder>
|
||||
- (instancetype)initWithCppResponder:(std::shared_ptr<facebook::flipper::FlipperResponder>)responder;
|
||||
@interface FlipperCppBridgingResponder : NSObject<FlipperResponder>
|
||||
- (instancetype)initWithCppResponder:
|
||||
(std::shared_ptr<facebook::flipper::FlipperResponder>)responder;
|
||||
@end
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
std::shared_ptr<facebook::flipper::FlipperResponder> responder_;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCppResponder:(std::shared_ptr<facebook::flipper::FlipperResponder>)responder
|
||||
{
|
||||
- (instancetype)initWithCppResponder:
|
||||
(std::shared_ptr<facebook::flipper::FlipperResponder>)responder {
|
||||
if (!responder) {
|
||||
return nil;
|
||||
}
|
||||
@@ -28,8 +28,14 @@
|
||||
|
||||
#pragma mark - FlipperResponder
|
||||
|
||||
- (void)success:(NSDictionary *)response { responder_->success(facebook::cxxutils::convertIdToFollyDynamic(response, true)); }
|
||||
- (void)success:(NSDictionary*)response {
|
||||
responder_->success(
|
||||
facebook::cxxutils::convertIdToFollyDynamic(response, true));
|
||||
}
|
||||
|
||||
- (void)error:(NSDictionary *)response { responder_->error(facebook::cxxutils::convertIdToFollyDynamic(response, true)); }
|
||||
- (void)error:(NSDictionary*)response {
|
||||
responder_->error(
|
||||
facebook::cxxutils::convertIdToFollyDynamic(response, true));
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
namespace facebook {
|
||||
namespace flipper {
|
||||
|
||||
using ObjCPlugin = NSObject<FlipperPlugin> *;
|
||||
using ObjCPlugin = NSObject<FlipperPlugin>*;
|
||||
|
||||
/**
|
||||
SonarCppWrapperPlugin is a simple C++ wrapper around Objective-C Sonar plugins
|
||||
@@ -24,19 +24,24 @@ that can be passed to SonarClient. This class allows developers to write pure
|
||||
Objective-C plugins if they want.
|
||||
*/
|
||||
class FlipperCppWrapperPlugin final : public facebook::flipper::FlipperPlugin {
|
||||
public:
|
||||
public:
|
||||
// Under ARC copying objCPlugin *does* increment its retain count
|
||||
FlipperCppWrapperPlugin(ObjCPlugin objCPlugin) : _objCPlugin(objCPlugin) {}
|
||||
|
||||
std::string identifier() const override { return [[_objCPlugin identifier] UTF8String]; }
|
||||
std::string identifier() const override {
|
||||
return [[_objCPlugin identifier] UTF8String];
|
||||
}
|
||||
|
||||
void didConnect(std::shared_ptr<facebook::flipper::FlipperConnection> conn) override
|
||||
{
|
||||
FlipperCppBridgingConnection *const bridgingConn = [[FlipperCppBridgingConnection alloc] initWithCppConnection:conn];
|
||||
void didConnect(
|
||||
std::shared_ptr<facebook::flipper::FlipperConnection> conn) override {
|
||||
FlipperCppBridgingConnection* const bridgingConn =
|
||||
[[FlipperCppBridgingConnection alloc] initWithCppConnection:conn];
|
||||
[_objCPlugin didConnect:bridgingConn];
|
||||
}
|
||||
|
||||
void didDisconnect() override { [_objCPlugin didDisconnect]; }
|
||||
void didDisconnect() override {
|
||||
[_objCPlugin didDisconnect];
|
||||
}
|
||||
|
||||
bool runInBackground() override {
|
||||
if ([_objCPlugin respondsToSelector:@selector(runInBackground)]) {
|
||||
@@ -45,9 +50,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjCPlugin getObjCPlugin() { return _objCPlugin; }
|
||||
ObjCPlugin getObjCPlugin() {
|
||||
return _objCPlugin;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
ObjCPlugin _objCPlugin;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user