Skip to content

Commit 8c7401c

Browse files
build: add ktlint gradle plugin
1 parent faba80a commit 8c7401c

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

app/build.gradle.kts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
2+
13
plugins {
24
id("com.android.application") version "8.7.1"
35
id("org.jetbrains.kotlin.android") version "2.1.10"
46
id("org.jetbrains.kotlin.plugin.compose") version "2.1.10"
57
id("org.jetbrains.kotlin.plugin.serialization") version "2.1.10"
68
id("com.google.protobuf") version "0.9.4"
9+
id("org.jlleitschuh.gradle.ktlint") version "12.1.2"
710
}
811

912
// This is the version of the app that is displayed in the UI on the drawer.
@@ -43,7 +46,6 @@ android {
4346
kotlinOptions {
4447
jvmTarget = "17"
4548
}
46-
4749
}
4850

4951
dependencies {
@@ -83,9 +85,9 @@ dependencies {
8385
implementation("com.google.zxing:core:3.4.1")
8486

8587
// Tests
86-
testImplementation ("junit:junit:4.13.2")
87-
androidTestImplementation ("androidx.test.ext:junit:1.2.1")
88-
androidTestImplementation ("androidx.test.espresso:espresso-core:3.6.1")
88+
testImplementation("junit:junit:4.13.2")
89+
androidTestImplementation("androidx.test.ext:junit:1.2.1")
90+
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
8991
}
9092

9193
protobuf {
@@ -103,3 +105,10 @@ protobuf {
103105
}
104106
}
105107
}
108+
109+
ktlint {
110+
ignoreFailures = false
111+
reporters {
112+
reporter(ReporterType.PLAIN).apply { outputToConsole = true }
113+
}
114+
}

0 commit comments

Comments
 (0)