build: switch to spotless (#355)
* build: switch to spotless add in some other basic formatting steps that allow for easy auto-correction * build: lint text files as well * chore: remove license headers from package-info files spotless can't verify these
This commit is contained in:
parent
cc7793925d
commit
ed7b7569a8
77 changed files with 81 additions and 1545 deletions
|
|
@ -1,6 +1,6 @@
|
|||
plugins {
|
||||
`kotlin-dsl`
|
||||
id("org.jlleitschuh.gradle.ktlint")
|
||||
id("com.diffplug.spotless")
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
|
@ -15,8 +15,14 @@ dependencies {
|
|||
implementation(libs.licenser)
|
||||
implementation(libs.gradleKotlinJvm)
|
||||
implementation(libs.gradleDokka)
|
||||
implementation(libs.gradleKtlint)
|
||||
implementation(libs.spotless)
|
||||
|
||||
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
|
||||
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
|
||||
}
|
||||
|
||||
spotless {
|
||||
kotlin {
|
||||
ktlint()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import org.cadixdev.gradle.licenser.header.HeaderStyle
|
|||
plugins {
|
||||
id("net.kyori.indra")
|
||||
id("net.kyori.indra.checkstyle")
|
||||
id("net.kyori.indra.license-header")
|
||||
id("com.diffplug.spotless")
|
||||
id("net.ltgt.errorprone")
|
||||
}
|
||||
|
||||
|
|
@ -40,10 +40,27 @@ tasks {
|
|||
}
|
||||
}
|
||||
|
||||
license {
|
||||
header(rootProject.file("HEADER"))
|
||||
style["java"] = HeaderStyle.DOUBLE_SLASH.format
|
||||
style["kt"] = HeaderStyle.DOUBLE_SLASH.format
|
||||
spotless {
|
||||
java {
|
||||
licenseHeaderFile(rootProject.file("HEADER"))
|
||||
importOrderFile(rootProject.file(".spotless/cloud.importorder"))
|
||||
indentWithSpaces(4)
|
||||
trimTrailingWhitespace()
|
||||
endWithNewline()
|
||||
}
|
||||
kotlin {
|
||||
licenseHeaderFile(rootProject.file("HEADER"))
|
||||
indentWithSpaces(4)
|
||||
trimTrailingWhitespace()
|
||||
endWithNewline()
|
||||
}
|
||||
format("configs") {
|
||||
target("**/*.yml", "**/*.yaml", "**/*.json")
|
||||
targetExclude("run/**")
|
||||
indentWithSpaces(2)
|
||||
trimTrailingWhitespace()
|
||||
endWithNewline()
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ plugins {
|
|||
id("cloud.base-conventions")
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("org.jlleitschuh.gradle.ktlint")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
|
@ -40,6 +39,12 @@ tasks {
|
|||
}
|
||||
}
|
||||
|
||||
spotless {
|
||||
kotlin {
|
||||
ktlint()
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
explicitApi()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue