2023-09-02 05:02:18 +02:00
|
|
|
import org.jlleitschuh.gradle.ktlint.KtlintExtension
|
|
|
|
import org.jlleitschuh.gradle.ktlint.KtlintPlugin
|
2023-01-19 04:33:56 +01:00
|
|
|
|
2023-09-02 05:02:18 +02:00
|
|
|
apply<KtlintPlugin>()
|
2023-01-19 04:33:56 +01:00
|
|
|
|
2023-09-02 05:02:18 +02:00
|
|
|
extensions.configure<KtlintExtension>("ktlint") {
|
|
|
|
version.set("0.50.0")
|
|
|
|
android.set(true)
|
|
|
|
enableExperimentalRules.set(true)
|
2023-01-19 04:33:56 +01:00
|
|
|
|
2023-09-02 05:02:18 +02:00
|
|
|
filter {
|
|
|
|
exclude("**/generated/**")
|
2023-11-18 19:54:56 +01:00
|
|
|
|
|
|
|
// For some reason this is needed for Kotlin MPP
|
|
|
|
exclude { tree ->
|
|
|
|
val path = tree.file.path
|
|
|
|
listOf("/generated/").any {
|
|
|
|
path.contains(it)
|
|
|
|
}
|
|
|
|
}
|
2023-01-19 04:33:56 +01:00
|
|
|
}
|
|
|
|
}
|