Skip to content

Commit

Permalink
Extend detekt exclusion rules
Browse files Browse the repository at this point in the history
Add exclusion for generated gRPC classes and make
sure neither those nor other generated classes
are included in the baseline.
  • Loading branch information
albin-mullvad committed Jun 7, 2024
1 parent 8a7bc6a commit fa21771
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask

plugins {
id(Dependencies.Plugin.dependencyCheckId) version Versions.Plugin.dependencyCheck apply false
Expand Down Expand Up @@ -34,7 +35,10 @@ val baselineFile = file("$rootDir/config/baseline.xml")
val configFile = files("$rootDir/config/detekt.yml")

val projectSource = file(projectDir)
val buildFiles = "**/build/**"
val detektExcludedPaths = listOf(
"**/build/**",
"**/mullvad_daemon/management_interface/**",
)

detekt {
buildUponDefaultConfig = true
Expand All @@ -49,7 +53,12 @@ detekt {

tasks.withType<Detekt>().configureEach {
// Ignore generated files from the build directory, e.g files created by ksp.
exclude(buildFiles)
exclude(detektExcludedPaths)
}

tasks.withType<DetektCreateBaselineTask>().configureEach {
// Ignore generated files from the build directory, e.g files created by ksp.
exclude(detektExcludedPaths)
}

allprojects {
Expand Down

0 comments on commit fa21771

Please sign in to comment.