Skip to content

Commit

Permalink
ci: add detekt compose ruleset, suppress compose function naming
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Bretting <[email protected]>
  • Loading branch information
luca-dot-sh committed Dec 17, 2024
1 parent 859f4ff commit d5a267d
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -121,6 +123,7 @@ tasks.cyclonedxBom {
}

detekt {
config = files("detekt.yml")
buildUponDefaultConfig = true
parallel = true
ignoreFailures = true
Expand Down
55 changes: 55 additions & 0 deletions frontend/app/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-FileCopyrightText: 2024 Luca Bretting <[email protected]>
#
# 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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions frontend/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" }
Expand Down

0 comments on commit d5a267d

Please sign in to comment.