Skip to content

Commit

Permalink
Wire up Detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
ephemient committed Dec 3, 2024
1 parent e9324fd commit 1c0b477
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
10 changes: 9 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,14 @@ kotlin {
}
}
}

targets.all target@{
compilations.all {
tasks.check {
dependsOn("detekt${this@target.targetName.capitalize()}${compilationName.capitalize()}")
}
}
}
}

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

targets.all target@{
compilations.all {
tasks.check {
dependsOn("detekt${this@target.targetName.capitalize()}${compilationName.capitalize()}")
}
}
}
}

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

0 comments on commit 1c0b477

Please sign in to comment.