From 4b7a54e027d9dadca3ee502d3bf361b3a75de174 Mon Sep 17 00:00:00 2001 From: Eldi Cano Date: Mon, 27 May 2024 19:03:58 +0200 Subject: [PATCH] adapt usages --- .github/workflows/pull_request.yml | 3 ++- app/build.gradle.kts | 2 +- .../spezi/app/ExampleInstrumentedTest.kt | 22 ------------------- build-logic/convention/build.gradle.kts | 2 +- .../extensions/DependencyHandler.kt | 2 +- .../logic/convention/extensions/Project.kt | 2 +- .../build/logic/convention/model/PluginId.kt | 2 +- .../plugins/HiltConventionPlugin.kt | 2 +- .../plugins/SpeziAbstractConfigPlugin.kt | 2 +- .../SpeziApplicationConventionPlugin.kt | 2 +- .../SpeziBaseConfigConventionPlugin.kt | 2 +- .../plugins/SpeziComposeConventionPlugin.kt | 2 +- .../plugins/SpeziLibraryConventionPlugin.kt | 2 +- build-logic/settings.gradle.kts | 2 +- config/detekt-config.yml | 8 +++++-- core/bluetooth/build.gradle.kts | 2 +- .../bluetooth/data/model/BLEDeviceSession.kt | 2 +- .../bluetooth/data/model/BLEServiceType.kt | 4 ++-- .../core/bluetooth/data/model/Measurement.kt | 8 +++---- core/coroutines/build.gradle.kts | 2 +- .../core/coroutines/di/CoroutinesModule.kt | 15 +------------ core/design/build.gradle.kts | 2 +- .../core/design/ExampleInstrumentedTest.kt | 22 ------------------- .../spezi/core/design/SpeziButtonKtTest.kt | 2 +- .../spezi/core/design/theme/SpeziKtTheme.kt | 2 +- core/logging/build.gradle.kts | 2 +- .../edu/stanford/spezi/core/logging/Api.kt | 2 +- .../core/logging/models/LoggingStrategy.kt | 2 +- core/testing/build.gradle.kts | 2 +- .../spezi/core/testing/CoroutineTestRule.kt | 2 +- .../edu/stanford/spezi/core/testing/Mockk.kt | 2 +- .../core/testing/TestDispatchersProvider.kt | 2 +- core/utils/build.gradle.kts | 2 +- modules/contact/build.gradle.kts | 2 +- .../spezi/modules/contact/ContactFactory.kt | 2 +- .../modules/contact/ContactScreenTest.kt | 10 ++++----- .../spezi/modules/contact/TestActivity.kt | 2 +- .../spezi/modules/contact/ContactScreen.kt | 2 +- .../spezi/modules/contact/model/Contact.kt | 4 ++-- modules/onboarding/build.gradle.kts | 2 +- 40 files changed, 52 insertions(+), 106 deletions(-) delete mode 100644 app/src/androidTest/kotlin/edu/stanford/spezi/app/ExampleInstrumentedTest.kt delete mode 100644 core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/ExampleInstrumentedTest.kt diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e0b5cab66..b5a4e61bd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,6 +10,7 @@ concurrency: jobs: detekt: + name: Detekt review runs-on: ubuntu-latest steps: @@ -23,11 +24,11 @@ jobs: uses: alaegin/Detekt-Action@v1.23.6 with: reviewdog_reporter: github-pr-review - fail_on_error: true github_token: ${{ secrets.github_token }} detekt_config: config/detekt-config.yml check: + name: Build and test needs: detekt runs-on: ubuntu-latest steps: diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 82d3b0a61..934657ac6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -36,4 +36,4 @@ dependencies { implementation(libs.hilt.navigation.compose) implementation(project(":core:bluetooth")) -} \ No newline at end of file +} diff --git a/app/src/androidTest/kotlin/edu/stanford/spezi/app/ExampleInstrumentedTest.kt b/app/src/androidTest/kotlin/edu/stanford/spezi/app/ExampleInstrumentedTest.kt deleted file mode 100644 index baf2c0341..000000000 --- a/app/src/androidTest/kotlin/edu/stanford/spezi/app/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,22 +0,0 @@ -package edu.stanford.spezi.app - -import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.test.platform.app.InstrumentationRegistry -import org.junit.Assert.assertEquals -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("edu.stanford.spezi.app", appContext.packageName) - } -} \ No newline at end of file diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index b79cc93e0..39020075d 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -48,4 +48,4 @@ gradlePlugin { conventionPlugin(id = "hilt", className = "HiltConventionPlugin") conventionPlugin(id = "library", className = "SpeziLibraryConventionPlugin") } -} \ No newline at end of file +} diff --git a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/extensions/DependencyHandler.kt b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/extensions/DependencyHandler.kt index 1fc3f96e2..28adcd2e5 100644 --- a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/extensions/DependencyHandler.kt +++ b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/extensions/DependencyHandler.kt @@ -16,4 +16,4 @@ internal fun DependencyHandler.debugImplementation(dependency: Any) { internal fun DependencyHandler.androidTestImplementation(dependency: Any) { add("androidTestImplementation", dependency) -} \ No newline at end of file +} diff --git a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/extensions/Project.kt b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/extensions/Project.kt index 9f5aa08b7..e527396bd 100644 --- a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/extensions/Project.kt +++ b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/extensions/Project.kt @@ -34,4 +34,4 @@ internal fun Project.commonExtensions(configBlock: CommonExtension<*,*,*,*,*,*>. isLibrary() -> extension(configBlock) else -> error("commonExtensions was called before setting the module type plugin") } -} \ No newline at end of file +} diff --git a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/model/PluginId.kt b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/model/PluginId.kt index 6bee74d3e..79e659e0d 100644 --- a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/model/PluginId.kt +++ b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/model/PluginId.kt @@ -7,4 +7,4 @@ enum class PluginId(val id: String) { HILT(id = "com.google.dagger.hilt.android"), KSP(id = "com.google.devtools.ksp"), COMPOSE_COMPILER("org.jetbrains.kotlin.plugin.compose") -} \ No newline at end of file +} diff --git a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/HiltConventionPlugin.kt b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/HiltConventionPlugin.kt index 16242b876..4cf7a4cf4 100644 --- a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/HiltConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/HiltConventionPlugin.kt @@ -29,4 +29,4 @@ class HiltConventionPlugin : Plugin { enableAggregatingTask = true } } -} \ No newline at end of file +} diff --git a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziAbstractConfigPlugin.kt b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziAbstractConfigPlugin.kt index ea6f2fa4f..a75413ca6 100644 --- a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziAbstractConfigPlugin.kt +++ b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziAbstractConfigPlugin.kt @@ -23,4 +23,4 @@ abstract class SpeziAbstractConfigPlugin(private val modulePlugin: PluginId) : P testImplementation(project(":core:testing")) } } -} \ No newline at end of file +} diff --git a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziApplicationConventionPlugin.kt b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziApplicationConventionPlugin.kt index 5de1cf6ec..0fd075597 100644 --- a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziApplicationConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziApplicationConventionPlugin.kt @@ -2,4 +2,4 @@ package edu.stanford.spezi.build.logic.convention.plugins import edu.stanford.spezi.build.logic.convention.model.PluginId -class SpeziApplicationConventionPlugin : SpeziAbstractConfigPlugin(modulePlugin = PluginId.ANDROID_APPLICATION) \ No newline at end of file +class SpeziApplicationConventionPlugin : SpeziAbstractConfigPlugin(modulePlugin = PluginId.ANDROID_APPLICATION) diff --git a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziBaseConfigConventionPlugin.kt b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziBaseConfigConventionPlugin.kt index 23da820d2..66d94e773 100644 --- a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziBaseConfigConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziBaseConfigConventionPlugin.kt @@ -59,4 +59,4 @@ class SpeziBaseConfigConventionPlugin : Plugin { } } } -} \ No newline at end of file +} diff --git a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziComposeConventionPlugin.kt b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziComposeConventionPlugin.kt index 45330e54e..976f83fd5 100644 --- a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziComposeConventionPlugin.kt @@ -36,4 +36,4 @@ class SpeziComposeConventionPlugin : Plugin { } } } -} \ No newline at end of file +} diff --git a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziLibraryConventionPlugin.kt index 017533eb7..4694e9954 100644 --- a/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/edu/stanford/spezi/build/logic/convention/plugins/SpeziLibraryConventionPlugin.kt @@ -2,4 +2,4 @@ package edu.stanford.spezi.build.logic.convention.plugins import edu.stanford.spezi.build.logic.convention.model.PluginId -class SpeziLibraryConventionPlugin : SpeziAbstractConfigPlugin(modulePlugin = PluginId.ANDROID_LIBRARY) \ No newline at end of file +class SpeziLibraryConventionPlugin : SpeziAbstractConfigPlugin(modulePlugin = PluginId.ANDROID_LIBRARY) diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts index b8c2f72bd..a0a40c169 100644 --- a/build-logic/settings.gradle.kts +++ b/build-logic/settings.gradle.kts @@ -12,4 +12,4 @@ dependencyResolutionManagement { } rootProject.name = "build-logic" -include(":convention") \ No newline at end of file +include(":convention") diff --git a/config/detekt-config.yml b/config/detekt-config.yml index a1ee69b8d..064653b2d 100644 --- a/config/detekt-config.yml +++ b/config/detekt-config.yml @@ -124,7 +124,7 @@ complexity: active: false threshold: 6 NamedArguments: - active: false + active: true threshold: 3 NestedBlockDepth: active: true @@ -400,12 +400,14 @@ formatting: StringTemplate: active: true autoCorrect: true + TrailingCommaOnDeclarationSite: + active: true + autoCorrect: true naming: active: true BooleanPropertyNaming: active: false - excludes: ['**/test/**', '**/androidTest/**'] allowedPattern: '^(is|has|are)' ClassNaming: active: true @@ -666,6 +668,8 @@ style: active: true NoTabs: active: false + NullableBooleanCheck: + active: true ObjectLiteralToLambda: active: false OptionalAbstractKeyword: diff --git a/core/bluetooth/build.gradle.kts b/core/bluetooth/build.gradle.kts index b1eb3cfd5..379ecaf65 100644 --- a/core/bluetooth/build.gradle.kts +++ b/core/bluetooth/build.gradle.kts @@ -10,4 +10,4 @@ android { dependencies { implementation(project(":core:utils")) implementation(project(":core:coroutines")) -} \ No newline at end of file +} diff --git a/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/BLEDeviceSession.kt b/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/BLEDeviceSession.kt index b52f9b643..602afd9e7 100644 --- a/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/BLEDeviceSession.kt +++ b/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/BLEDeviceSession.kt @@ -12,5 +12,5 @@ import android.bluetooth.BluetoothDevice */ data class BLEDeviceSession( val device: BluetoothDevice, - val measurements: List + val measurements: List, ) diff --git a/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/BLEServiceType.kt b/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/BLEServiceType.kt index 0222b0fda..ee0d67c3f 100644 --- a/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/BLEServiceType.kt +++ b/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/BLEServiceType.kt @@ -15,7 +15,7 @@ internal enum class BLEServiceType( /** * The UUID of the characteristic associated with the BLE service. */ - val characteristic: UUID + val characteristic: UUID, ) { /** * Represents the Weight service. @@ -31,5 +31,5 @@ internal enum class BLEServiceType( BLOOD_PRESSURE( service = UUID("00001810-0000-1000-8000-00805f9b34fb"), characteristic = UUID("00002a35-0000-1000-8000-00805f9b34fb") - ) + ), } diff --git a/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/Measurement.kt b/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/Measurement.kt index b048290df..87c21885a 100644 --- a/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/Measurement.kt +++ b/core/bluetooth/src/main/kotlin/edu/stanford/spezi/core/bluetooth/data/model/Measurement.kt @@ -23,7 +23,7 @@ sealed interface Measurement { val timeStampSecond: Int, // 0-59 val pulseRate: Float, // pulse rate value bpm val userId: Int, - val measurementStatus: Status + val measurementStatus: Status, ) : Measurement { /** @@ -34,7 +34,7 @@ sealed interface Measurement { val timeStampFlag: Boolean, // false: no timestamp, true: timestamp present val pulseRateFlag: Boolean, // false: no pulse rate, true: pulse rate present val userIdFlag: Boolean, // false: no user ID, true: user ID present - val measurementStatusFlag: Boolean // false: no measurement status, true: measurement status present + val measurementStatusFlag: Boolean, // false: no measurement status, true: measurement status present ) /** @@ -45,7 +45,7 @@ sealed interface Measurement { val cuffFitDetectionFlag: Boolean, // 0: fit properly, 1: too loose val irregularPulseDetectionFlag: Boolean, // 0: no irregular pulse detected, 1: irregular pulse detected val pulseRateRangeDetectionFlags: Int, // - always 0 - val measurementPositionDetectionFlag: Boolean // false: proper, true: improper + val measurementPositionDetectionFlag: Boolean, // false: proper, true: improper ) } @@ -57,6 +57,6 @@ sealed interface Measurement { val zonedDateTime: ZonedDateTime?, val userId: Int?, val bmi: Double?, - val height: Double? + val height: Double?, ) : Measurement } diff --git a/core/coroutines/build.gradle.kts b/core/coroutines/build.gradle.kts index da2ca8997..b2613fd50 100644 --- a/core/coroutines/build.gradle.kts +++ b/core/coroutines/build.gradle.kts @@ -9,4 +9,4 @@ android { dependencies { api(libs.bundles.ktx.coroutines) -} \ No newline at end of file +} diff --git a/core/coroutines/src/main/kotlin/edu/stanford/spezi/core/coroutines/di/CoroutinesModule.kt b/core/coroutines/src/main/kotlin/edu/stanford/spezi/core/coroutines/di/CoroutinesModule.kt index 294c6d2e7..99c58ff52 100644 --- a/core/coroutines/src/main/kotlin/edu/stanford/spezi/core/coroutines/di/CoroutinesModule.kt +++ b/core/coroutines/src/main/kotlin/edu/stanford/spezi/core/coroutines/di/CoroutinesModule.kt @@ -22,25 +22,12 @@ import kotlinx.coroutines.SupervisorJob @InstallIn(SingletonComponent::class) class CoroutinesModule { - - - - val _thisShouldFaileWithVariableNamingMagicNumberIndentationEmptyLine = 12345 - - - - val _thisShouldFaileWithVariableNsdamingMagicNumberIndentationEmptyLine = 12345 - /** * Hilt module for binding the implementation of [DispatchersProvider] to its interface. */ @Module @InstallIn(SingletonComponent::class) - - - - abstract class Bindings { /** * Binds the [DispatchersProviderImpl] implementation to the [DispatchersProvider] interface. @@ -190,6 +177,6 @@ class CoroutinesModule { */ @VisibleForTesting internal fun buildCoroutine( - dispatcher: CoroutineDispatcher + dispatcher: CoroutineDispatcher, ): CoroutineScope = CoroutineScope(context = dispatcher + SupervisorJob()) } diff --git a/core/design/build.gradle.kts b/core/design/build.gradle.kts index a8d811114..919e7347f 100644 --- a/core/design/build.gradle.kts +++ b/core/design/build.gradle.kts @@ -25,4 +25,4 @@ dependencies { debugImplementation(libs.compose.ui.tooling) debugImplementation(libs.compose.ui.test.manifest) -} \ No newline at end of file +} diff --git a/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/ExampleInstrumentedTest.kt b/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/ExampleInstrumentedTest.kt deleted file mode 100644 index 71113246c..000000000 --- a/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,22 +0,0 @@ -package edu.stanford.spezi.core.design - -import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.test.platform.app.InstrumentationRegistry -import org.junit.Assert.assertEquals -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("edu.stanford.spezi.core.design.test", appContext.packageName) - } -} \ No newline at end of file diff --git a/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/SpeziButtonKtTest.kt b/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/SpeziButtonKtTest.kt index 477587615..e56dbbde1 100644 --- a/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/SpeziButtonKtTest.kt +++ b/core/design/src/androidTest/kotlin/edu/stanford/spezi/core/design/SpeziButtonKtTest.kt @@ -84,4 +84,4 @@ class SpeziButtonKtTest { assert(clicked) } -} \ No newline at end of file +} diff --git a/core/design/src/main/kotlin/edu/stanford/spezi/core/design/theme/SpeziKtTheme.kt b/core/design/src/main/kotlin/edu/stanford/spezi/core/design/theme/SpeziKtTheme.kt index 4ead10c4d..1d9801ac6 100644 --- a/core/design/src/main/kotlin/edu/stanford/spezi/core/design/theme/SpeziKtTheme.kt +++ b/core/design/src/main/kotlin/edu/stanford/spezi/core/design/theme/SpeziKtTheme.kt @@ -52,7 +52,7 @@ private val LightColorScheme = lightColorScheme( fun SpeziTheme( darkTheme: Boolean = isSystemInDarkTheme(), dynamicColor: Boolean = true, - content: @Composable () -> Unit + content: @Composable () -> Unit, ) { val colorScheme = when { dynamicColor -> { diff --git a/core/logging/build.gradle.kts b/core/logging/build.gradle.kts index e67ea28dd..5a8a29af9 100644 --- a/core/logging/build.gradle.kts +++ b/core/logging/build.gradle.kts @@ -11,4 +11,4 @@ android { dependencies { implementation(libs.timber) testImplementation(libs.bundles.unit.testing) -} \ No newline at end of file +} diff --git a/core/logging/src/main/kotlin/edu/stanford/spezi/core/logging/Api.kt b/core/logging/src/main/kotlin/edu/stanford/spezi/core/logging/Api.kt index 12a4eaf85..555bd95c8 100644 --- a/core/logging/src/main/kotlin/edu/stanford/spezi/core/logging/Api.kt +++ b/core/logging/src/main/kotlin/edu/stanford/spezi/core/logging/Api.kt @@ -46,5 +46,5 @@ fun groupLogger(tag: String, config: LoggerConfig.() -> Unit = {}) = object : Re */ fun speziLogger( tag: String, - config: LoggerConfig.() -> Unit = {} + config: LoggerConfig.() -> Unit = {}, ) = lazy { SpeziLogger(tag, LoggerConfig().apply(config)) } diff --git a/core/logging/src/main/kotlin/edu/stanford/spezi/core/logging/models/LoggingStrategy.kt b/core/logging/src/main/kotlin/edu/stanford/spezi/core/logging/models/LoggingStrategy.kt index 4f484f60e..33316206f 100644 --- a/core/logging/src/main/kotlin/edu/stanford/spezi/core/logging/models/LoggingStrategy.kt +++ b/core/logging/src/main/kotlin/edu/stanford/spezi/core/logging/models/LoggingStrategy.kt @@ -19,5 +19,5 @@ enum class LoggingStrategy { /** * The logging strategy that logs messages using the Log utility. */ - LOG + LOG, } diff --git a/core/testing/build.gradle.kts b/core/testing/build.gradle.kts index c71b82acc..4d103c57c 100644 --- a/core/testing/build.gradle.kts +++ b/core/testing/build.gradle.kts @@ -11,4 +11,4 @@ android { dependencies { implementation(project(":core:coroutines")) api(libs.bundles.unit.testing) -} \ No newline at end of file +} diff --git a/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/CoroutineTestRule.kt b/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/CoroutineTestRule.kt index 3ac683a8c..60f6aed2f 100644 --- a/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/CoroutineTestRule.kt +++ b/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/CoroutineTestRule.kt @@ -37,7 +37,7 @@ import org.junit.runner.Description * */ class CoroutineTestRule( - private val testDispatcher: TestDispatcher = UnconfinedTestDispatcher() + private val testDispatcher: TestDispatcher = UnconfinedTestDispatcher(), ) : TestWatcher() { /** diff --git a/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/Mockk.kt b/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/Mockk.kt index 3d137e890..73b85879f 100644 --- a/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/Mockk.kt +++ b/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/Mockk.kt @@ -33,5 +33,5 @@ fun verifyNever(verifyBlock: MockKVerificationScope.() -> Unit) = verify(exactly * @param verifyBlock The suspendable block of code containing the interaction to verify. */ fun coVerifyNever( - verifyBlock: suspend MockKVerificationScope.() -> Unit + verifyBlock: suspend MockKVerificationScope.() -> Unit, ) = coVerify(exactly = 0, verifyBlock = verifyBlock) diff --git a/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/TestDispatchersProvider.kt b/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/TestDispatchersProvider.kt index 389b44933..b8be01837 100644 --- a/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/TestDispatchersProvider.kt +++ b/core/testing/src/main/kotlin/edu/stanford/spezi/core/testing/TestDispatchersProvider.kt @@ -12,7 +12,7 @@ import kotlinx.coroutines.test.UnconfinedTestDispatcher * @property testDispatcher The [CoroutineDispatcher] to be used for all dispatcher contexts. Defaults to [UnconfinedTestDispatcher]. */ class TestDispatchersProvider( - private val testDispatcher: CoroutineDispatcher = UnconfinedTestDispatcher() + private val testDispatcher: CoroutineDispatcher = UnconfinedTestDispatcher(), ) : DispatchersProvider { /** diff --git a/core/utils/build.gradle.kts b/core/utils/build.gradle.kts index 89b0c2bf0..1c0364848 100644 --- a/core/utils/build.gradle.kts +++ b/core/utils/build.gradle.kts @@ -10,4 +10,4 @@ dependencies { val composeBom = platform(libs.compose.bom) implementation(composeBom) implementation(libs.compose.runtime) -} \ No newline at end of file +} diff --git a/modules/contact/build.gradle.kts b/modules/contact/build.gradle.kts index af8c7cbba..ecc4954de 100644 --- a/modules/contact/build.gradle.kts +++ b/modules/contact/build.gradle.kts @@ -10,4 +10,4 @@ android { dependencies { testImplementation(project(":core:testing")) androidTestImplementation(libs.bundles.compose.androidTest) -} \ No newline at end of file +} diff --git a/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/ContactFactory.kt b/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/ContactFactory.kt index 1aae6c37e..ee07b5680 100644 --- a/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/ContactFactory.kt +++ b/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/ContactFactory.kt @@ -18,4 +18,4 @@ object ContactFactory { ): Contact { return Contact(id, icon, name, title, description, organization, address, options) } -} \ No newline at end of file +} diff --git a/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/ContactScreenTest.kt b/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/ContactScreenTest.kt index 9923e5bef..398df1d7c 100644 --- a/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/ContactScreenTest.kt +++ b/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/ContactScreenTest.kt @@ -34,7 +34,6 @@ class ContactScreenTest { composeTestRule.onNodeWithText(contact.name).assertExists() } - @Test fun contactView_displaysContactOptions() { val contact = ContactFactory.create( @@ -90,15 +89,14 @@ class ContactScreenTest { @Test fun contactView_displaysContactDescription() { - val contact = - ContactFactory.create(description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") + val description = "Lorem ipsum dolor sit amet" + val contact = ContactFactory.create(description = description) every { mockContactRepository.getContact() } returns contact composeTestRule.setContent { ContactScreen(ContactViewModel(mockContactRepository)) } - composeTestRule.onNodeWithText(mockContactRepository.getContact().description) - .assertExists() + composeTestRule.onNodeWithText(description).assertExists() } -} \ No newline at end of file +} diff --git a/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/TestActivity.kt b/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/TestActivity.kt index 314d0bdda..199503515 100644 --- a/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/TestActivity.kt +++ b/modules/contact/src/androidTest/kotlin/edu/stanford/spezi/modules/contact/TestActivity.kt @@ -2,4 +2,4 @@ package edu.stanford.spezi.modules.contact import androidx.activity.ComponentActivity -class TestActivity : ComponentActivity() \ No newline at end of file +class TestActivity : ComponentActivity() diff --git a/modules/contact/src/main/kotlin/edu/stanford/spezi/modules/contact/ContactScreen.kt b/modules/contact/src/main/kotlin/edu/stanford/spezi/modules/contact/ContactScreen.kt index c3b2ddc18..6648541e3 100644 --- a/modules/contact/src/main/kotlin/edu/stanford/spezi/modules/contact/ContactScreen.kt +++ b/modules/contact/src/main/kotlin/edu/stanford/spezi/modules/contact/ContactScreen.kt @@ -134,7 +134,7 @@ fun ContactScreen(viewModel: ContactViewModel) { @Preview @Composable fun ContactScreenPreview( - @PreviewParameter(ContactViewModelPreviewParameterProvider::class) viewModel: ContactViewModel + @PreviewParameter(ContactViewModelPreviewParameterProvider::class) viewModel: ContactViewModel, ) { SpeziTheme { ContactScreen(viewModel) diff --git a/modules/contact/src/main/kotlin/edu/stanford/spezi/modules/contact/model/Contact.kt b/modules/contact/src/main/kotlin/edu/stanford/spezi/modules/contact/model/Contact.kt index 341d7f875..385d6e115 100644 --- a/modules/contact/src/main/kotlin/edu/stanford/spezi/modules/contact/model/Contact.kt +++ b/modules/contact/src/main/kotlin/edu/stanford/spezi/modules/contact/model/Contact.kt @@ -27,7 +27,7 @@ data class Contact( val description: String, val organization: String, val address: String, - val options: List + val options: List, ) /** @@ -46,7 +46,7 @@ data class ContactOption( val name: String, val value: String, val icon: ImageVector?, - val optionType: ContactOptionType + val optionType: ContactOptionType, ) /** diff --git a/modules/onboarding/build.gradle.kts b/modules/onboarding/build.gradle.kts index 5a805d56b..0ffcb9cac 100644 --- a/modules/onboarding/build.gradle.kts +++ b/modules/onboarding/build.gradle.kts @@ -5,4 +5,4 @@ plugins { android { namespace = "edu.stanford.spezi.modules.onboarding" -} \ No newline at end of file +}