Skip to content

Commit

Permalink
enable check to prevent java wildcard imports (#942)
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh authored Jul 19, 2022
1 parent 0a6960f commit a3fcd6a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gradle/validation/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ configure(project(":solr").subprojects) { prj ->
target "modules/**/examples/*.java"
break
}

custom 'Refuse wildcard imports', {
// Wildcard imports can't be resolved by spotless itself.
// This will require the developer themselves to adhere to best practices.
if (it =~ /\nimport .*\*;/) {
throw new AssertionError("Do not use wildcard imports. 'spotlessApply' cannot resolve this issue.")
}
}
}
}

Expand Down

0 comments on commit a3fcd6a

Please sign in to comment.