mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-25 10:37:51 +02:00
Add spotless (with ktlint) (#1136)
This commit is contained in:
@ -3,6 +3,8 @@ import mihon.buildlogic.configureCompose
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
kotlin("android")
|
||||
|
||||
id("mihon.code.lint")
|
||||
}
|
||||
|
||||
android {
|
||||
|
@ -5,6 +5,8 @@ import mihon.buildlogic.configureTest
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
kotlin("android")
|
||||
|
||||
id("mihon.code.lint")
|
||||
}
|
||||
|
||||
android {
|
||||
|
@ -4,6 +4,8 @@ import mihon.buildlogic.configureTest
|
||||
plugins {
|
||||
id("com.android.test")
|
||||
kotlin("android")
|
||||
|
||||
id("mihon.code.lint")
|
||||
}
|
||||
|
||||
android {
|
||||
|
30
buildSrc/src/main/kotlin/mihon.code.lint.gradle.kts
Normal file
30
buildSrc/src/main/kotlin/mihon.code.lint.gradle.kts
Normal file
@ -0,0 +1,30 @@
|
||||
import org.gradle.accessors.dm.LibrariesForLibs
|
||||
|
||||
plugins {
|
||||
id("com.diffplug.spotless")
|
||||
}
|
||||
|
||||
val libs = the<LibrariesForLibs>()
|
||||
|
||||
spotless {
|
||||
kotlin {
|
||||
target("**/*.kt", "**/*.kts")
|
||||
targetExclude("**/build/**/*.kt")
|
||||
ktlint(libs.ktlint.core.get().version)
|
||||
.editorConfigOverride(mapOf(
|
||||
"ktlint_function_naming_ignore_when_annotated_with" to "Composable",
|
||||
"ktlint_standard_class-signature" to "disabled",
|
||||
"ktlint_standard_discouraged-comment-location" to "disabled",
|
||||
"ktlint_standard_function-expression-body" to "disabled",
|
||||
"ktlint_standard_function-signature" to "disabled",
|
||||
))
|
||||
trimTrailingWhitespace()
|
||||
endWithNewline()
|
||||
}
|
||||
format("xml") {
|
||||
target("**/*.xml")
|
||||
targetExclude("**/build/**/*.xml")
|
||||
trimTrailingWhitespace()
|
||||
endWithNewline()
|
||||
}
|
||||
}
|
@ -2,6 +2,8 @@ import mihon.buildlogic.configureCompose
|
||||
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
|
||||
id("mihon.code.lint")
|
||||
}
|
||||
|
||||
android {
|
||||
|
@ -3,6 +3,8 @@ import mihon.buildlogic.configureTest
|
||||
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
|
||||
id("mihon.code.lint")
|
||||
}
|
||||
|
||||
android {
|
||||
|
Reference in New Issue
Block a user