From 81c416028ae8e4c60d23cd77f7ed7945689a91f4 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Thu, 26 Jun 2025 21:28:45 -0400 Subject: [PATCH] Configure Spotless to automatically remove unused imports. --- build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.gradle b/build.gradle index 1be18acef45..e3ed2543fef 100644 --- a/build.gradle +++ b/build.gradle @@ -35,13 +35,17 @@ def isCI = System.getenv("CI") != null apply from: "$rootDir/gradle/repositories.gradle" apply from: "$rootDir/gradle/scm.gradle" + spotless { // only resolve the spotless dependencies once in the build predeclareDeps() } + spotlessPredeclare { // these need to align with the types and versions in gradle/spotless.gradle java { + removeUnusedImports() + // This is the last Google Java Format version that supports Java 8 googleJavaFormat('1.7') }