summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson90@gmail.com>2024-01-30 09:37:51 +0100
committerAlbin <albin@mullvad.net>2024-02-05 17:51:37 +0100
commit2f762a6106c4bb07805410b1b1dbd954b5f48f4e (patch)
tree61548a793c3ff085b09cda0df4084bf26012e827 /android
parent4c9a451eb1f4780ec62d5b6461403eb0aed40393 (diff)
downloadmullvadvpn-2f762a6106c4bb07805410b1b1dbd954b5f48f4e.tar.xz
mullvadvpn-2f762a6106c4bb07805410b1b1dbd954b5f48f4e.zip
Add detekt gradle configuration
Diffstat (limited to 'android')
-rw-r--r--android/build.gradle.kts25
1 files changed, 25 insertions, 0 deletions
diff --git a/android/build.gradle.kts b/android/build.gradle.kts
index 8f801b85a7..46573d80c2 100644
--- a/android/build.gradle.kts
+++ b/android/build.gradle.kts
@@ -1,9 +1,11 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
+import io.gitlab.arturbosch.detekt.Detekt
plugins {
id(Dependencies.Plugin.dependencyCheckId) version Versions.Plugin.dependencyCheck apply false
id(Dependencies.Plugin.gradleVersionsId) version Versions.Plugin.gradleVersions
id(Dependencies.Plugin.ktfmtId) version Versions.Plugin.ktfmt apply false
+ id(Dependencies.Plugin.detektId) version Versions.Plugin.detekt
}
buildscript {
@@ -11,6 +13,7 @@ buildscript {
google()
mavenCentral()
maven(Repositories.GradlePlugins)
+ gradlePluginPortal()
}
dependencies {
@@ -27,6 +30,28 @@ buildscript {
}
}
+val baselineFile = file("$rootDir/config/baseline.xml")
+val configFile = files("$rootDir/config/detekt.yml")
+
+val projectSource = file(projectDir)
+val buildFiles = "**/build/**"
+
+detekt {
+ buildUponDefaultConfig = true
+ allRules = false
+ config.setFrom(configFile)
+ source.setFrom(projectSource)
+ baseline = baselineFile
+ parallel = true
+ ignoreFailures = false
+ autoCorrect = true
+}
+
+tasks.withType<Detekt>().configureEach {
+ // Ignore generated files from the build directory, e.g files created by ksp.
+ exclude(buildFiles)
+}
+
allprojects {
apply(plugin = Dependencies.Plugin.dependencyCheckId)
apply(plugin = Dependencies.Plugin.ktfmtId)