Skip to content

Commit 0b7faf1

Browse files
authored
Dogfood the newest Spotless 8.0.0 (#2642)
2 parents ab58cf9 + a0d9dbe commit 0b7faf1

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

gradle/spotless.gradle

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
apply plugin: 'com.diffplug.spotless'
22
spotless {
3-
def noInternalDepsClosure = {
4-
String text = it
5-
/*
6-
* No good way to get around using this import:
7-
* https://github.com/gradle/gradle/issues/3191
8-
*/
9-
String regex = "import org\\.gradle\\.api\\.internal\\.(?!plugins\\.DslObject)(?!project\\.ProjectInternal)"
10-
if ((text.contains('import org.gradle.internal.') || text.find(regex)) &&
11-
!text.contains('def noInternalDepsClosure')) {
12-
throw new AssertionError("Accidental internal import")
13-
}
14-
}
153
if (project != rootProject) {
164
// the rootProject doesn't have any java
175
java {
@@ -22,9 +10,9 @@ spotless {
2210
eclipse().configFile rootProject.file('gradle/spotless.eclipseformat.xml')
2311
trimTrailingWhitespace()
2412
removeUnusedImports()
25-
removeWildcardImports()
2613
formatAnnotations()
27-
custom 'noInternalDeps', noInternalDepsClosure
14+
forbidWildcardImports()
15+
forbidRegex('ForbidGradleInternal', 'import org\\.gradle\\.api\\.internal\\.(.*)', "Don't use Gradle's internal API")
2816
}
2917
}
3018
groovyGradle {

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pluginManagement {
66
}
77

88
plugins {
9-
id 'com.diffplug.spotless' version '7.2.1' apply false
9+
id 'com.diffplug.spotless' version '8.0.0' apply false
1010
// https://plugins.gradle.org/plugin/com.gradle.plugin-publish
1111
id 'com.gradle.plugin-publish' version '2.0.0' apply false
1212
// https://github.com/gradle-nexus/publish-plugin/releases

0 commit comments

Comments
 (0)