diff --git a/frontend/app/build.gradle.kts b/frontend/app/build.gradle.kts index c86b403b..42537483 100644 --- a/frontend/app/build.gradle.kts +++ b/frontend/app/build.gradle.kts @@ -106,6 +106,8 @@ dependencies { implementation(libs.vico.compose.m2) implementation(libs.vico.compose.m3) implementation(libs.vico.core) + + detektPlugins(libs.detekt.compose.rules) } tasks.cyclonedxBom { @@ -121,6 +123,7 @@ tasks.cyclonedxBom { } detekt { + config = files("detekt.yml") buildUponDefaultConfig = true parallel = true ignoreFailures = true diff --git a/frontend/app/detekt.yml b/frontend/app/detekt.yml new file mode 100644 index 00000000..8731a91c --- /dev/null +++ b/frontend/app/detekt.yml @@ -0,0 +1,55 @@ +# SPDX-FileCopyrightText: 2024 Luca Bretting +# +# SPDX-License-Identifier: MIT + +naming: + FunctionNaming: + active: true + ignoreAnnotated: + - Composable + +TwitterCompose: + CompositionLocalAllowlist: + active: true + # You can optionally define a list of CompositionLocals that are allowed here + # allowedCompositionLocals: LocalSomething,LocalSomethingElse + CompositionLocalNaming: + active: true + ContentEmitterReturningValues: + active: true + # You can optionally add your own composables here + # contentEmitters: MyComposable,MyOtherComposable + ModifierComposable: + active: true + ModifierMissing: + active: true + ModifierReused: + active: true + ModifierWithoutDefault: + active: true + MultipleEmitters: + active: true + # You can optionally add your own composables here + # contentEmitters: MyComposable,MyOtherComposable + MutableParams: + active: true + ComposableNaming: + active: true + # You can optionally disable the checks in this rule for regex matches against the composable name (e.g. molecule presenters) + # allowedComposableFunctionNames: .*Presenter,.*MoleculePresenter + ComposableParamOrder: + active: true + PreviewNaming: + active: true + PreviewPublic: + active: true + # You can optionally disable that only previews with @PreviewParameter are flagged + # previewPublicOnlyIfParams: false + RememberMissing: + active: true + UnstableCollections: + active: true + ViewModelForwarding: + active: true + ViewModelInjection: + active: true \ No newline at end of file diff --git a/frontend/app/src/main/java/de/amosproj3/ziofa/ui/shared/Settings.kt b/frontend/app/src/main/java/de/amosproj3/ziofa/ui/shared/Settings.kt index 642f5618..8c1f98fc 100644 --- a/frontend/app/src/main/java/de/amosproj3/ziofa/ui/shared/Settings.kt +++ b/frontend/app/src/main/java/de/amosproj3/ziofa/ui/shared/Settings.kt @@ -5,7 +5,7 @@ package de.amosproj3.ziofa.ui.shared /** How often the process list should be refreshed from the backend */ -val PROCESS_LIST_REFRESH_INTERVAL_MS = 1000L +const val PROCESS_LIST_REFRESH_INTERVAL_MS = 1000L /** The maximum number of datapoints to show on screen */ const val TIME_SERIES_SIZE = 20 diff --git a/frontend/gradle/libs.versions.toml b/frontend/gradle/libs.versions.toml index f24203fa..a862bc01 100644 --- a/frontend/gradle/libs.versions.toml +++ b/frontend/gradle/libs.versions.toml @@ -13,6 +13,7 @@ composeBom = "2024.11.00" coreKtx = "1.15.0" cyclonedx = "1.10.0" detekt = "1.23.7" +detektRulesVersion = "0.0.26" espressoCore = "3.6.1" jna = "5.15.0" junit = "4.13.2" @@ -42,6 +43,7 @@ androidx-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" } androidx-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" } androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } +detekt-compose-rules = { module = "com.twitter.compose.rules:detekt", version.ref = "detektRulesVersion" } jackwharton-timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" } jna = { module = "net.java.dev.jna:jna", version.ref = "jna" } junit = { module = "junit:junit", version.ref = "junit" }