Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wire up Detekt #18

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion kt/aoc2024-exe/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kotlin {
it.binaries.executable {
entryPoint("com.github.ephemient.aoc2024.exe.main")
}
}
},
).onEach {
it.compilations {
create("bench") {
Expand Down Expand Up @@ -66,6 +66,15 @@ kotlin {
}
}
}

val detektTaskNames = targets.flatMap { target ->
target.compilations.map { compilation ->
"detekt${target.targetName.capitalize()}${compilation.compilationName.capitalize()}"
}
}
tasks.check {
dependsOn(detektTaskNames)
}
}

dependencies {
Expand Down
9 changes: 9 additions & 0 deletions kt/aoc2024-lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ kotlin {
}
}
}

val detektTaskNames = targets.flatMap { target ->
target.compilations.map { compilation ->
"detekt${target.targetName.capitalize()}${compilation.compilationName.capitalize()}"
}
}
tasks.check {
dependsOn(detektTaskNames)
}
}

val jvmTestCompilation = kotlin.jvm().compilations.getByName("test")
Expand Down
10 changes: 9 additions & 1 deletion kt/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
plugins {
base
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.plugin.allopen) apply false
alias(libs.plugins.detekt)
alias(libs.plugins.kotlinx.benchmark) apply false
}

group = "com.github.ephemient.aoc2024"
dependencies {
detektPlugins(libs.bundles.detekt.plugins)
}

detekt {
source.from(allprojects.map { it.buildFile })
}
3 changes: 3 additions & 0 deletions kt/config/detekt/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
style:
MagicNumber:
active: false
Loading