Skip to content

Commit e2a1730

Browse files
committed
feat: introduce spotless formatting for java
1 parent f5c6fa7 commit e2a1730

File tree

6 files changed

+29
-2
lines changed

6 files changed

+29
-2
lines changed

.idea/misc.xml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/palantir-java-format.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build-logic/src/main/groovy/buildlogic.java-common-conventions.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
plugins {
88
// Apply the java Plugin to add support for Java.
99
id 'java'
10+
id 'buildlogic.spotless-java-conventions'
1011
}
1112

1213
repositories {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
plugins {
2+
id 'com.diffplug.spotless'
3+
}
4+
5+
spotless {
6+
// ratchetFrom 'origin/main'
7+
encoding 'UTF-8'
8+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
plugins {
2+
id 'buildlogic.spotless-common-conventions'
3+
}
4+
5+
spotless {
6+
java {
7+
palantirJavaFormat()
8+
formatAnnotations()
9+
removeUnusedImports()
10+
importOrder('java|javax', 'org', 'com', 'com.diffplug', '', '\\#')
11+
}
12+
}

settings.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ pluginManagement {
1414
plugins {
1515
// Apply the foojay-resolver plugin to allow automatic download of JDKs
1616
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
17+
18+
// https://github.com/diffplug/spotless/blob/main/plugin-gradle/CHANGES.md
19+
id 'com.diffplug.spotless' version '7.0.2' apply false
1720
}
1821

1922
rootProject.name = 'spotless-cli'

0 commit comments

Comments
 (0)