diff --git a/gradle/rewrite.gradle b/gradle/rewrite.gradle index 9f75f75e96..4464ee652c 100644 --- a/gradle/rewrite.gradle +++ b/gradle/rewrite.gradle @@ -2,6 +2,7 @@ apply plugin: 'org.openrewrite.rewrite' rewrite { activeRecipe('com.diffplug.spotless.openrewrite.SanityCheck') + activeStyle('com.diffplug.spotless.openrewrite.SpotlessFormat') exclusions.addAll( '**.dirty.java', '**FormatterProperties.java', diff --git a/rewrite.yml b/rewrite.yml index f313847200..a7f4e4654d 100644 --- a/rewrite.yml +++ b/rewrite.yml @@ -24,6 +24,7 @@ recipeList: - org.openrewrite.java.recipes.JavaRecipeBestPractices - org.openrewrite.java.recipes.RecipeTestingBestPractices - org.openrewrite.java.security.JavaSecurityBestPractices + - org.openrewrite.staticanalysis.BufferedWriterCreationRecipes - org.openrewrite.staticanalysis.CommonStaticAnalysis - org.openrewrite.staticanalysis.EqualsAvoidsNull - org.openrewrite.staticanalysis.JavaApiBestPractices @@ -36,6 +37,9 @@ recipeList: - org.openrewrite.staticanalysis.RemoveUnusedLocalVariables - org.openrewrite.staticanalysis.RemoveUnusedPrivateFields - org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods + - org.openrewrite.staticanalysis.ReplaceApacheCommonsLang3ValidateNotNullWithObjectsRequireNonNull + - org.openrewrite.staticanalysis.SimplifyTernaryRecipes + - org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes - org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources - org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments - org.openrewrite.staticanalysis.UnnecessaryParentheses @@ -59,3 +63,28 @@ recipeList: - tech.picnic.errorprone.refasterrules.StringRulesRecipes - tech.picnic.errorprone.refasterrules.TimeRulesRecipes --- +name: com.diffplug.spotless.openrewrite.SpotlessFormat +styleConfigs: + - org.openrewrite.java.style.ImportLayoutStyle: + classCountToUseStarImport: 999 + nameCountToUseStarImport: 999 + # bug https://github.com/openrewrite/rewrite/issues/6107 + # layout: + # - import java.* + # - + # - import javax.* + # - + # - import org.* + # - + # - import com.* + # - + # - import com.diffplug.* + # - + # - import static all other imports + # - + # - import all other imports + # - + - org.openrewrite.java.style.TabsAndIndentsStyle: + useTabCharacter: true + tabSize: 4 +---