Skip to content

Commit

Permalink
Add spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
vgskye committed Nov 2, 2024
1 parent f3edb1c commit 0480641
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ plugins {
// Also it looks like property lookups don't work this early
id 'fabric-loom' version '1.6-SNAPSHOT' apply false

id "com.diffplug.spotless" version "6.25.0" apply false

id("at.petra-k.PKPlugin") version "0.1.0-pre-87"
id("at.petra-k.PKSubprojPlugin") version "0.1.0-pre-87" apply false
}
Expand Down Expand Up @@ -47,6 +49,7 @@ subprojects {
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: "com.diffplug.spotless"

tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
Expand All @@ -72,6 +75,17 @@ subprojects {
sourcesJar {
duplicatesStrategy 'exclude'
}

spotless {
enforceCheck = false
java {
removeUnusedImports()
googleJavaFormat()
formatAnnotations()
indentWithTabs(2)
importOrder('\\#', 'java|javax', 'net.minecraft|com.mojang', 'net.fabricmc|net.minecraftforge', 'at.petrak', '')
}
}
}

allprojects {
Expand Down

0 comments on commit 0480641

Please sign in to comment.