diff --git a/testframework/build.gradle b/testframework/build.gradle index 77a836be65..0caa8fd3f6 100644 --- a/testframework/build.gradle +++ b/testframework/build.gradle @@ -36,5 +36,14 @@ spotless { toggleOffOn() eclipse().configFile rootProject.file('codeformat/formatter-config.xml') importOrder() + + // courtesy of diffplug/spotless#240 + // https://github.com/diffplug/spotless/issues/240#issuecomment-385206606 + custom 'noWildcardImports', { String fileContents -> + if (fileContents.contains('*;\n')) { + throw new GradleException('No wildcard imports are allowed!') + } + } + bumpThisNumberIfACustomStepChanges(1) } -} \ No newline at end of file +} diff --git a/tests/build.gradle b/tests/build.gradle index f9c6dcec1e..3ae4763568 100644 --- a/tests/build.gradle +++ b/tests/build.gradle @@ -113,5 +113,14 @@ spotless { toggleOffOn() eclipse().configFile rootProject.file('codeformat/formatter-config.xml') importOrder() + + // courtesy of diffplug/spotless#240 + // https://github.com/diffplug/spotless/issues/240#issuecomment-385206606 + custom 'noWildcardImports', { String fileContents -> + if (fileContents.contains('*;\n')) { + throw new GradleException('No wildcard imports are allowed!') + } + } + bumpThisNumberIfACustomStepChanges(1) } }