Skip to content

Commit 16c491f

Browse files
Add Spotless
1 parent 8230277 commit 16c491f

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id "com.diffplug.spotless" version "5.12.4"
3+
}
4+
15
apply plugin: 'java'
26
apply plugin: 'maven'
37

@@ -48,3 +52,23 @@ wrapper {
4852
gradleVersion = "6.1.1"
4953
distributionType = Wrapper.DistributionType.ALL
5054
}
55+
56+
spotless {
57+
// optional: limit format enforcement to just the files changed by this feature branch
58+
ratchetFrom 'origin/master'
59+
format 'misc', {
60+
// define the files to apply `misc` to
61+
target '*.gradle', '.gitignore'
62+
// define the steps to apply to those files
63+
64+
trimTrailingWhitespace()
65+
indentWithSpaces(2)
66+
endWithNewline()
67+
}
68+
java {
69+
target 'src/**/*.java'
70+
// apply google-java-format
71+
removeUnusedImports()
72+
googleJavaFormat('1.9')
73+
}
74+
}

0 commit comments

Comments
 (0)