Skip to content

Commit ddab6c5

Browse files
committed
Add spotless
1 parent dbc1cb4 commit ddab6c5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ plugins {
1717
// Also it looks like property lookups don't work this early
1818
id 'fabric-loom' version '1.6-SNAPSHOT' apply false
1919

20+
id "com.diffplug.spotless" version "6.25.0" apply false
21+
2022
id("at.petra-k.PKPlugin") version "0.1.0-pre-87"
2123
id("at.petra-k.PKSubprojPlugin") version "0.1.0-pre-87" apply false
2224
}
@@ -47,6 +49,7 @@ subprojects {
4749
apply plugin: 'java'
4850
apply plugin: 'kotlin'
4951
apply plugin: 'maven-publish'
52+
apply plugin: "com.diffplug.spotless"
5053

5154
tasks.withType(JavaCompile).configureEach {
5255
it.options.encoding = 'UTF-8'
@@ -72,6 +75,17 @@ subprojects {
7275
sourcesJar {
7376
duplicatesStrategy 'exclude'
7477
}
78+
79+
spotless {
80+
enforceCheck = false
81+
java {
82+
removeUnusedImports()
83+
googleJavaFormat()
84+
formatAnnotations()
85+
indentWithTabs(2)
86+
importOrder('\\#', 'java|javax', 'net.minecraft|com.mojang', 'net.fabricmc|net.minecraftforge', 'at.petrak', '')
87+
}
88+
}
7589
}
7690

7791
allprojects {

0 commit comments

Comments
 (0)