Skip to content

Commit 76a6d3f

Browse files
committed
[#2855] Create spotless rule for package-info.java
And `module-info.java`. Spotless ingores package-info.java files (see diffplug/spotless#532), but we can create a rule that applies it if the file contains a javadoc. Note that if the package-info.java doesn't have a javadoc, it will cause an exception at compile time.
1 parent ca28960 commit 76a6d3f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ subprojects {
2727
trimTrailingWhitespace()
2828
endWithNewline()
2929
}
30+
format 'javaMisc', {
31+
target 'src/**/package-info.java', 'src/**/module-info.java'
32+
licenseHeaderFile rootProject.file( 'spotless.license.java' ), '/\\*\\*'
33+
}
3034
}
3135

3236
tasks.compileJava.dependsOn(spotlessApply)

0 commit comments

Comments
 (0)