-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EMBR-4352] Run Swiftlint/Clang-format over RN iOS module (#194)
- Loading branch information
1 parent
c14a332
commit 9e99955
Showing
34 changed files
with
404 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
BasedOnStyle: Google | ||
IndentWidth: 4 | ||
UseTab: Never | ||
BreakBeforeBraces: Attach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yarn run lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
included: | ||
- packages | ||
- integration-tests | ||
- examples | ||
|
||
excluded: | ||
- Pods | ||
- node_modules | ||
|
||
disabled_rules: # rule identifiers turned on by default to exclude from running | ||
- identifier_name | ||
- function_parameter_count | ||
- notification_center_detachment | ||
- compiler_protocol_init | ||
|
||
opt_in_rules: | ||
- conditional_returns_on_newline | ||
|
||
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging, summary) | ||
|
||
file_length: | ||
warning: 800 | ||
error: 1000 | ||
|
||
line_length: | ||
ignores_comments: true | ||
ignores_interpolated_strings: true | ||
|
||
type_body_length: | ||
warning: 600 | ||
error: 800 | ||
|
||
type_name: | ||
max_length: | ||
warning: 60 | ||
allowed_symbols: ["_"] | ||
|
||
function_body_length: | ||
warning: 100 | ||
error: 300 | ||
|
||
large_tuple: | ||
warning: 4 | ||
error: 6 | ||
|
||
cyclomatic_complexity: | ||
ignores_case_statements: true | ||
warning: 20 | ||
error: 30 |
11 changes: 5 additions & 6 deletions
11
examples/react-native-test-suite/android/app/src/main/jni/MainApplicationModuleProvider.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
#pragma once | ||
|
||
#include <ReactCommon/JavaTurboModule.h> | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include <ReactCommon/JavaTurboModule.h> | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
std::shared_ptr<TurboModule> MainApplicationModuleProvider( | ||
const std::string moduleName, | ||
const JavaTurboModule::InitParams ¶ms); | ||
const std::string moduleName, const JavaTurboModule::InitParams ¶ms); | ||
|
||
} // namespace react | ||
} // namespace facebook | ||
} // namespace react | ||
} // namespace facebook |
59 changes: 30 additions & 29 deletions
59
...ct-native-test-suite/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,39 @@ | ||
#include <memory> | ||
#include <string> | ||
|
||
#include <ReactCommon/TurboModuleManagerDelegate.h> | ||
#include <fbjni/fbjni.h> | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
class MainApplicationTurboModuleManagerDelegate | ||
: public jni::HybridClass< | ||
MainApplicationTurboModuleManagerDelegate, | ||
TurboModuleManagerDelegate> { | ||
public: | ||
// Adapt it to the package you used for your Java class. | ||
static constexpr auto kJavaDescriptor = | ||
"Lcom/embracetestsuite/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; | ||
|
||
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>); | ||
|
||
static void registerNatives(); | ||
|
||
std::shared_ptr<TurboModule> getTurboModule( | ||
const std::string name, | ||
const std::shared_ptr<CallInvoker> jsInvoker) override; | ||
std::shared_ptr<TurboModule> getTurboModule( | ||
const std::string name, | ||
const JavaTurboModule::InitParams ¶ms) override; | ||
|
||
/** | ||
* Test-only method. Allows user to verify whether a TurboModule can be | ||
* created by instances of this class. | ||
*/ | ||
bool canCreateTurboModule(std::string name); | ||
: public jni::HybridClass<MainApplicationTurboModuleManagerDelegate, | ||
TurboModuleManagerDelegate> { | ||
public: | ||
// Adapt it to the package you used for your Java class. | ||
static constexpr auto kJavaDescriptor = | ||
"Lcom/embracetestsuite/newarchitecture/modules/" | ||
"MainApplicationTurboModuleManagerDelegate;"; | ||
|
||
static jni::local_ref<jhybriddata> initHybrid( | ||
jni::alias_ref<jhybridobject>); | ||
|
||
static void registerNatives(); | ||
|
||
std::shared_ptr<TurboModule> getTurboModule( | ||
const std::string name, | ||
const std::shared_ptr<CallInvoker> jsInvoker) override; | ||
std::shared_ptr<TurboModule> getTurboModule( | ||
const std::string name, | ||
const JavaTurboModule::InitParams ¶ms) override; | ||
|
||
/** | ||
* Test-only method. Allows user to verify whether a TurboModule can be | ||
* created by instances of this class. | ||
*/ | ||
bool canCreateTurboModule(std::string name); | ||
}; | ||
|
||
} // namespace react | ||
} // namespace facebook | ||
} // namespace react | ||
} // namespace facebook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 17 additions & 20 deletions
37
examples/react-native-test-suite/ios/EmbraceTestSuite/AppDelegate.mm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.