47 lines
1.4 KiB
Groovy
47 lines
1.4 KiB
Groovy
apply plugin: "com.diffplug.spotless"
|
|
|
|
spotless { // if you are using build.gradle.kts, instead of 'spotless {' use:
|
|
// configure<com.diffplug.gradle.spotless.SpotlessExtension> {
|
|
kotlin {
|
|
// by default the target is every '.kt' and '.kts` file in the java sourcesets
|
|
ktfmt() // has its own section below
|
|
ktlint() // has its own section below
|
|
diktat() // has its own section below
|
|
prettier() // has its own section below
|
|
licenseHeader '/* (C)$YEAR */' // or licenseHeaderFile
|
|
}
|
|
kotlinGradle {
|
|
target '*.gradle.kts' // default target for kotlinGradle
|
|
ktlint() // or ktfmt() or prettier()
|
|
}
|
|
}
|
|
|
|
|
|
//spotless {
|
|
// java {
|
|
// target '**/*.java'
|
|
// googleJavaFormat().aosp()
|
|
// removeUnusedImports()
|
|
// trimTrailingWhitespace()
|
|
// indentWithSpaces()
|
|
// endWithNewline()
|
|
// } kotlin {
|
|
// target '**/*.kt'
|
|
// ktlint()
|
|
// trimTrailingWhitespace()
|
|
// indentWithSpaces()
|
|
// endWithNewline()
|
|
// } format 'misc', {
|
|
// target '**/*.gradle', '**/*.md', '**/.gitignore'
|
|
// indentWithSpaces()
|
|
// trimTrailingWhitespace()
|
|
// endWithNewline()
|
|
// }
|
|
//
|
|
// format 'xml', {
|
|
// target '**/*.xml'
|
|
// indentWithSpaces()
|
|
// trimTrailingWhitespace()
|
|
// endWithNewline()
|
|
// }
|
|
//} |