-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply spotless to all java projects (#3184)
- Loading branch information
Showing
64 changed files
with
1,313 additions
and
1,208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
buildscript { | ||
repositories { | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.google.googlejavaformat:google-java-format:1.18.1' | ||
} | ||
} | ||
|
||
apply plugin: 'com.diffplug.spotless' | ||
|
||
spotless { | ||
// We run the check separately on CI, so don't run this by default | ||
enforceCheck = false | ||
|
||
java { | ||
licenseHeaderFile rootProject.file('config/spotless/spotless.header') | ||
|
||
custom 'google-java-format', { source -> | ||
com.google.googlejavaformat.java.JavaFormatterOptions options = new com.google.googlejavaformat.java.AutoValue_JavaFormatterOptions.Builder() | ||
.style(com.google.googlejavaformat.java.JavaFormatterOptions.Style.AOSP) | ||
.formatJavadoc(false) | ||
.reorderModifiers(true) | ||
.build() | ||
com.google.googlejavaformat.java.Formatter formatter = new com.google.googlejavaformat.java.Formatter(options) | ||
return formatter.formatSource(source) | ||
} | ||
|
||
// This test contains emulation of same-line stubbings. The formatter would put them on a separate line. | ||
targetExclude 'src/test/java/org/mockitousage/internal/junit/UnusedStubbingsFinderTest.java' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.