Browse Source

Replace ktlint plugin with Spotless

The original plugin did not check all sourcesets :(

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Álvaro Brey 2 years ago
parent
commit
0d646233b0
1 changed files with 11 additions and 2 deletions
  1. 11 2
      app/build.gradle

+ 11 - 2
app/build.gradle

@@ -13,10 +13,13 @@ buildscript {
         classpath "org.jacoco:org.jacoco.core:$jacoco_version"
         classpath "org.jacoco:org.jacoco.report:$jacoco_version"
         classpath "org.jacoco:org.jacoco.agent:$jacoco_version"
-        classpath "org.jlleitschuh.gradle:ktlint-gradle:10.3.0"
     }
 }
 
+plugins {
+    id "com.diffplug.spotless" version "6.11.0"
+}
+
 apply plugin: 'com.android.application'
 
 apply plugin: 'kotlin-android'
@@ -28,7 +31,6 @@ apply plugin: 'com.hiya.jacoco-android'
 apply plugin: 'com.github.spotbugs'
 apply plugin: 'io.gitlab.arturbosch.detekt'
 apply plugin: 'shot'
-apply plugin: "org.jlleitschuh.gradle.ktlint"
 
 println "Gradle uses Java ${Jvm.current()}"
 
@@ -386,6 +388,13 @@ task installGitHooks(type: Copy, group: "development") {
     into "${project.rootDir}/.git/hooks"
 }
 
+spotless {
+    kotlin {
+        target "**/*.kt"
+        ktlint()
+    }
+}
+
 detekt {
     reports {
         xml {