Skip to content
Snippets Groups Projects
Commit d85129aa authored by Charles Lombardo's avatar Charles Lombardo
Browse files

Android: Use ktlint for Kotlin code style

parent a29fa119
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import android.annotation.SuppressLint import android.annotation.SuppressLint
import kotlin.collections.setOf
import org.jetbrains.kotlin.konan.properties.Properties import org.jetbrains.kotlin.konan.properties.Properties
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
plugins { plugins {
id("com.android.application") id("com.android.application")
...@@ -10,6 +12,7 @@ plugins { ...@@ -10,6 +12,7 @@ plugins {
id("kotlin-parcelize") id("kotlin-parcelize")
kotlin("plugin.serialization") version "1.8.21" kotlin("plugin.serialization") version "1.8.21"
id("androidx.navigation.safeargs.kotlin") id("androidx.navigation.safeargs.kotlin")
id("org.jlleitschuh.gradle.ktlint") version "11.4.0"
} }
/** /**
...@@ -157,6 +160,23 @@ android { ...@@ -157,6 +160,23 @@ android {
} }
} }
tasks.getByPath("preBuild").dependsOn("ktlintCheck")
ktlint {
version.set("0.47.0")
android.set(true)
ignoreFailures.set(false)
disabledRules.set(
setOf(
"no-wildcard-imports",
"package-name"
)
)
reporters {
reporter(ReporterType.CHECKSTYLE)
}
}
dependencies { dependencies {
implementation("androidx.core:core-ktx:1.10.1") implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.appcompat:appcompat:1.6.1") implementation("androidx.appcompat:appcompat:1.6.1")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment