From 4341263bffacaac774137a855f81427fd676ab28 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Fri, 7 Feb 2025 13:19:27 +0200 Subject: [PATCH] Lint fixes --- .../java/com/testappplain/MainActivity.kt | 22 ++++--- .../java/com/testappplain/MainApplication.kt | 57 ++++++++++--------- .../ios/TestAppPlain/AppDelegate.swift | 4 +- .../java/com/testappsentry/MainActivity.kt | 22 ++++--- .../java/com/testappsentry/MainApplication.kt | 57 ++++++++++--------- .../ios/TestAppSentry/AppDelegate.swift | 4 +- 6 files changed, 82 insertions(+), 84 deletions(-) diff --git a/performance-tests/TestAppPlain/android/app/src/main/java/com/testappplain/MainActivity.kt b/performance-tests/TestAppPlain/android/app/src/main/java/com/testappplain/MainActivity.kt index c1dc95014..e2333b50d 100644 --- a/performance-tests/TestAppPlain/android/app/src/main/java/com/testappplain/MainActivity.kt +++ b/performance-tests/TestAppPlain/android/app/src/main/java/com/testappplain/MainActivity.kt @@ -6,17 +6,15 @@ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnable import com.facebook.react.defaults.DefaultReactActivityDelegate class MainActivity : ReactActivity() { + /** + * Returns the name of the main component registered from JavaScript. This is used to schedule + * rendering of the component. + */ + override fun getMainComponentName(): String = "TestAppPlain" - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun getMainComponentName(): String = "TestAppPlain" - - /** - * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] - * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] - */ - override fun createReactActivityDelegate(): ReactActivityDelegate = - DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) + /** + * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] + * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] + */ + override fun createReactActivityDelegate(): ReactActivityDelegate = DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) } diff --git a/performance-tests/TestAppPlain/android/app/src/main/java/com/testappplain/MainApplication.kt b/performance-tests/TestAppPlain/android/app/src/main/java/com/testappplain/MainApplication.kt index 35f021088..2ea5f6468 100644 --- a/performance-tests/TestAppPlain/android/app/src/main/java/com/testappplain/MainApplication.kt +++ b/performance-tests/TestAppPlain/android/app/src/main/java/com/testappplain/MainApplication.kt @@ -12,33 +12,34 @@ import com.facebook.react.defaults.DefaultReactNativeHost import com.facebook.react.soloader.OpenSourceMergedSoMapping import com.facebook.soloader.SoLoader -class MainApplication : Application(), ReactApplication { - - override val reactNativeHost: ReactNativeHost = - object : DefaultReactNativeHost(this) { - override fun getPackages(): List = - PackageList(this).packages.apply { - // Packages that cannot be autolinked yet can be added manually here, for example: - // add(MyReactNativePackage()) - } - - override fun getJSMainModuleName(): String = "index" - - override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG - - override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED - override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED - } - - override val reactHost: ReactHost - get() = getDefaultReactHost(applicationContext, reactNativeHost) - - override fun onCreate() { - super.onCreate() - SoLoader.init(this, OpenSourceMergedSoMapping) - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - // If you opted-in for the New Architecture, we load the native entry point for this app. - load() +class MainApplication : + Application(), + ReactApplication { + override val reactNativeHost: ReactNativeHost = + object : DefaultReactNativeHost(this) { + override fun getPackages(): List = + PackageList(this).packages.apply { + // Packages that cannot be autolinked yet can be added manually here, for example: + // add(MyReactNativePackage()) + } + + override fun getJSMainModuleName(): String = "index" + + override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG + + override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED + override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED + } + + override val reactHost: ReactHost + get() = getDefaultReactHost(applicationContext, reactNativeHost) + + override fun onCreate() { + super.onCreate() + SoLoader.init(this, OpenSourceMergedSoMapping) + if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { + // If you opted-in for the New Architecture, we load the native entry point for this app. + load() + } } - } } diff --git a/performance-tests/TestAppPlain/ios/TestAppPlain/AppDelegate.swift b/performance-tests/TestAppPlain/ios/TestAppPlain/AppDelegate.swift index ac1946e90..3b36adc16 100644 --- a/performance-tests/TestAppPlain/ios/TestAppPlain/AppDelegate.swift +++ b/performance-tests/TestAppPlain/ios/TestAppPlain/AppDelegate.swift @@ -1,11 +1,11 @@ -import UIKit import React import React_RCTAppDelegate import ReactAppDependencyProvider +import UIKit @main class AppDelegate: RCTAppDelegate { - override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { self.moduleName = "TestAppPlain" self.dependencyProvider = RCTAppDependencyProvider() diff --git a/performance-tests/TestAppSentry/android/app/src/main/java/com/testappsentry/MainActivity.kt b/performance-tests/TestAppSentry/android/app/src/main/java/com/testappsentry/MainActivity.kt index 4c290ba51..3bba8479f 100644 --- a/performance-tests/TestAppSentry/android/app/src/main/java/com/testappsentry/MainActivity.kt +++ b/performance-tests/TestAppSentry/android/app/src/main/java/com/testappsentry/MainActivity.kt @@ -6,17 +6,15 @@ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnable import com.facebook.react.defaults.DefaultReactActivityDelegate class MainActivity : ReactActivity() { + /** + * Returns the name of the main component registered from JavaScript. This is used to schedule + * rendering of the component. + */ + override fun getMainComponentName(): String = "TestAppSentry" - /** - * Returns the name of the main component registered from JavaScript. This is used to schedule - * rendering of the component. - */ - override fun getMainComponentName(): String = "TestAppSentry" - - /** - * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] - * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] - */ - override fun createReactActivityDelegate(): ReactActivityDelegate = - DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) + /** + * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] + * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] + */ + override fun createReactActivityDelegate(): ReactActivityDelegate = DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) } diff --git a/performance-tests/TestAppSentry/android/app/src/main/java/com/testappsentry/MainApplication.kt b/performance-tests/TestAppSentry/android/app/src/main/java/com/testappsentry/MainApplication.kt index 64f33a7ef..24f040d0d 100644 --- a/performance-tests/TestAppSentry/android/app/src/main/java/com/testappsentry/MainApplication.kt +++ b/performance-tests/TestAppSentry/android/app/src/main/java/com/testappsentry/MainApplication.kt @@ -12,33 +12,34 @@ import com.facebook.react.defaults.DefaultReactNativeHost import com.facebook.react.soloader.OpenSourceMergedSoMapping import com.facebook.soloader.SoLoader -class MainApplication : Application(), ReactApplication { - - override val reactNativeHost: ReactNativeHost = - object : DefaultReactNativeHost(this) { - override fun getPackages(): List = - PackageList(this).packages.apply { - // Packages that cannot be autolinked yet can be added manually here, for example: - // add(MyReactNativePackage()) - } - - override fun getJSMainModuleName(): String = "index" - - override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG - - override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED - override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED - } - - override val reactHost: ReactHost - get() = getDefaultReactHost(applicationContext, reactNativeHost) - - override fun onCreate() { - super.onCreate() - SoLoader.init(this, OpenSourceMergedSoMapping) - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - // If you opted-in for the New Architecture, we load the native entry point for this app. - load() +class MainApplication : + Application(), + ReactApplication { + override val reactNativeHost: ReactNativeHost = + object : DefaultReactNativeHost(this) { + override fun getPackages(): List = + PackageList(this).packages.apply { + // Packages that cannot be autolinked yet can be added manually here, for example: + // add(MyReactNativePackage()) + } + + override fun getJSMainModuleName(): String = "index" + + override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG + + override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED + override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED + } + + override val reactHost: ReactHost + get() = getDefaultReactHost(applicationContext, reactNativeHost) + + override fun onCreate() { + super.onCreate() + SoLoader.init(this, OpenSourceMergedSoMapping) + if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { + // If you opted-in for the New Architecture, we load the native entry point for this app. + load() + } } - } } diff --git a/performance-tests/TestAppSentry/ios/TestAppSentry/AppDelegate.swift b/performance-tests/TestAppSentry/ios/TestAppSentry/AppDelegate.swift index bd916942d..78a0ff44c 100644 --- a/performance-tests/TestAppSentry/ios/TestAppSentry/AppDelegate.swift +++ b/performance-tests/TestAppSentry/ios/TestAppSentry/AppDelegate.swift @@ -1,11 +1,11 @@ -import UIKit import React import React_RCTAppDelegate import ReactAppDependencyProvider +import UIKit @main class AppDelegate: RCTAppDelegate { - override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { self.moduleName = "TestAppSentry" self.dependencyProvider = RCTAppDependencyProvider()