Skip to content

Commit

Permalink
adapt usages
Browse files Browse the repository at this point in the history
  • Loading branch information
eldcn committed May 27, 2024
1 parent c3791a1 commit 4b7a54e
Show file tree
Hide file tree
Showing 40 changed files with 52 additions and 106 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ concurrency:

jobs:
detekt:
name: Detekt review
runs-on: ubuntu-latest

steps:
Expand All @@ -23,11 +24,11 @@ jobs:
uses: alaegin/[email protected]
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:
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ dependencies {
implementation(libs.hilt.navigation.compose)

implementation(project(":core:bluetooth"))
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ gradlePlugin {
conventionPlugin(id = "hilt", className = "HiltConventionPlugin")
conventionPlugin(id = "library", className = "SpeziLibraryConventionPlugin")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ internal fun DependencyHandler.debugImplementation(dependency: Any) {

internal fun DependencyHandler.androidTestImplementation(dependency: Any) {
add("androidTestImplementation", dependency)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ internal fun Project.commonExtensions(configBlock: CommonExtension<*,*,*,*,*,*>.
isLibrary() -> extension<LibraryExtension>(configBlock)
else -> error("commonExtensions was called before setting the module type plugin")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ class HiltConventionPlugin : Plugin<Project> {
enableAggregatingTask = true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ abstract class SpeziAbstractConfigPlugin(private val modulePlugin: PluginId) : P
testImplementation(project(":core:testing"))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
class SpeziApplicationConventionPlugin : SpeziAbstractConfigPlugin(modulePlugin = PluginId.ANDROID_APPLICATION)
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ class SpeziBaseConfigConventionPlugin : Plugin<Project> {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ class SpeziComposeConventionPlugin : Plugin<Project> {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
class SpeziLibraryConventionPlugin : SpeziAbstractConfigPlugin(modulePlugin = PluginId.ANDROID_LIBRARY)
2 changes: 1 addition & 1 deletion build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ dependencyResolutionManagement {
}

rootProject.name = "build-logic"
include(":convention")
include(":convention")
8 changes: 6 additions & 2 deletions config/detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ complexity:
active: false
threshold: 6
NamedArguments:
active: false
active: true
threshold: 3
NestedBlockDepth:
active: true
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -666,6 +668,8 @@ style:
active: true
NoTabs:
active: false
NullableBooleanCheck:
active: true
ObjectLiteralToLambda:
active: false
OptionalAbstractKeyword:
Expand Down
2 changes: 1 addition & 1 deletion core/bluetooth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ android {
dependencies {
implementation(project(":core:utils"))
implementation(project(":core:coroutines"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ import android.bluetooth.BluetoothDevice
*/
data class BLEDeviceSession(
val device: BluetoothDevice,
val measurements: List<Measurement>
val measurements: List<Measurement>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -31,5 +31,5 @@ internal enum class BLEServiceType(
BLOOD_PRESSURE(
service = UUID("00001810-0000-1000-8000-00805f9b34fb"),
characteristic = UUID("00002a35-0000-1000-8000-00805f9b34fb")
)
),
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand All @@ -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
)

/**
Expand All @@ -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
)
}

Expand All @@ -57,6 +57,6 @@ sealed interface Measurement {
val zonedDateTime: ZonedDateTime?,
val userId: Int?,
val bmi: Double?,
val height: Double?
val height: Double?,
) : Measurement
}
2 changes: 1 addition & 1 deletion core/coroutines/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ android {

dependencies {
api(libs.bundles.ktx.coroutines)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -190,6 +177,6 @@ class CoroutinesModule {
*/
@VisibleForTesting
internal fun buildCoroutine(
dispatcher: CoroutineDispatcher
dispatcher: CoroutineDispatcher,
): CoroutineScope = CoroutineScope(context = dispatcher + SupervisorJob())
}
2 changes: 1 addition & 1 deletion core/design/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ dependencies {

debugImplementation(libs.compose.ui.tooling)
debugImplementation(libs.compose.ui.test.manifest)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ class SpeziButtonKtTest {

assert(clicked)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand Down
2 changes: 1 addition & 1 deletion core/logging/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ android {
dependencies {
implementation(libs.timber)
testImplementation(libs.bundles.unit.testing)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)) }
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ enum class LoggingStrategy {
/**
* The logging strategy that logs messages using the Log utility.
*/
LOG
LOG,
}
2 changes: 1 addition & 1 deletion core/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ android {
dependencies {
implementation(project(":core:coroutines"))
api(libs.bundles.unit.testing)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import org.junit.runner.Description
*
*/
class CoroutineTestRule(
private val testDispatcher: TestDispatcher = UnconfinedTestDispatcher()
private val testDispatcher: TestDispatcher = UnconfinedTestDispatcher(),
) : TestWatcher() {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand Down
2 changes: 1 addition & 1 deletion core/utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ dependencies {
val composeBom = platform(libs.compose.bom)
implementation(composeBom)
implementation(libs.compose.runtime)
}
}
2 changes: 1 addition & 1 deletion modules/contact/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ android {
dependencies {
testImplementation(project(":core:testing"))
androidTestImplementation(libs.bundles.compose.androidTest)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ object ContactFactory {
): Contact {
return Contact(id, icon, name, title, description, organization, address, options)
}
}
}
Loading

0 comments on commit 4b7a54e

Please sign in to comment.