Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion rewrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ recipeList:
- org.openrewrite.gradle.EnableGradleParallelExecution
- org.openrewrite.gradle.GradleBestPractices
- org.openrewrite.java.RemoveUnusedImports
- org.openrewrite.java.ShortenFullyQualifiedTypeReferences
- org.openrewrite.java.SimplifySingleElementAnnotation
- org.openrewrite.java.format.EmptyNewlineAtEndOfFile
- org.openrewrite.java.format.NormalizeFormat
- org.openrewrite.java.format.NormalizeLineBreaks
- org.openrewrite.java.format.PadEmptyForLoopComponents
- org.openrewrite.java.format.RemoveTrailingWhitespace
- org.openrewrite.java.migrate.UpgradeToJava17
- org.openrewrite.java.migrate.lang.JavaLangAPIs
- org.openrewrite.java.migrate.lang.StringRulesRecipes
- org.openrewrite.java.migrate.util.JavaLangAPIs
- org.openrewrite.java.migrate.util.JavaUtilAPIs
- org.openrewrite.java.migrate.util.MigrateInflaterDeflaterToClose
- org.openrewrite.java.migrate.util.ReplaceStreamCollectWithToList
Expand All @@ -22,19 +26,32 @@ recipeList:
- org.openrewrite.java.recipes.RecipeTestingBestPractices
- org.openrewrite.java.security.JavaSecurityBestPractices
- org.openrewrite.staticanalysis.BufferedWriterCreationRecipes
- org.openrewrite.staticanalysis.ChainStringBuilderAppendCalls
- org.openrewrite.staticanalysis.CommonStaticAnalysis
- org.openrewrite.staticanalysis.CustomImportOrder
- org.openrewrite.staticanalysis.DefaultComesLast
- org.openrewrite.staticanalysis.EmptyBlock
- org.openrewrite.staticanalysis.EqualsAvoidsNull
- org.openrewrite.staticanalysis.ExplicitInitialization
- org.openrewrite.staticanalysis.FallThrough
- org.openrewrite.staticanalysis.FinalizePrivateFields
- org.openrewrite.staticanalysis.ForLoopControlVariablePostfixOperators
- org.openrewrite.staticanalysis.HideUtilityClassConstructor
- org.openrewrite.staticanalysis.JavaApiBestPractices
- org.openrewrite.staticanalysis.LowercasePackage
- org.openrewrite.staticanalysis.MissingOverrideAnnotation
- org.openrewrite.staticanalysis.ModifierOrder
- org.openrewrite.staticanalysis.NeedBraces
- org.openrewrite.staticanalysis.NoFinalizer
- org.openrewrite.staticanalysis.NoToStringOnStringType
- org.openrewrite.staticanalysis.NoValueOfOnStringType
- org.openrewrite.staticanalysis.RemoveUnusedLocalVariables
- org.openrewrite.staticanalysis.RemoveUnusedPrivateFields
- org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods
- org.openrewrite.staticanalysis.ReplaceStringBuilderWithString
- org.openrewrite.staticanalysis.ReplaceThreadRunWithThreadStart
- org.openrewrite.staticanalysis.SimplifyTernaryRecipes
- org.openrewrite.staticanalysis.TypecastParenPad
- org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes
- org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources
- org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments
Expand Down
53 changes: 0 additions & 53 deletions testlib/src/main/java/com/diffplug/spotless/ReflectionUtil.java

This file was deleted.

24 changes: 9 additions & 15 deletions testlib/src/main/java/com/diffplug/spotless/TestProvisioner.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2025 DiffPlug
* Copyright 2016-2026 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,8 @@
*/
package com.diffplug.spotless;

import static com.diffplug.common.base.Suppliers.memoize;

import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream;
Expand All @@ -38,11 +40,15 @@

import com.diffplug.common.base.Errors;
import com.diffplug.common.base.StandardSystemProperty;
import com.diffplug.common.base.Suppliers;
import com.diffplug.common.collect.ImmutableSet;
import com.diffplug.common.io.Files;

public class TestProvisioner {
public final class TestProvisioner {

private static final Supplier<Provisioner> MAVEN_CENTRAL = memoize(() -> caching("mavenCentral", () -> createWithRepositories(RepositoryHandler::mavenCentral)));

private TestProvisioner() {}

public static Project gradleProject(File dir) {
File userHome = new File(StandardSystemProperty.USER_HOME.value());
return ProjectBuilder.builder()
Expand Down Expand Up @@ -143,16 +149,4 @@ public static Provisioner mavenCentral() {
return MAVEN_CENTRAL.get();
}

private static final Supplier<Provisioner> MAVEN_CENTRAL = Suppliers.memoize(() -> caching("mavenCentral", () -> createWithRepositories(RepositoryHandler::mavenCentral)));

/** Creates a Provisioner for the local maven repo for development purpose. */
public static Provisioner mavenLocal() {
return createWithRepositories(RepositoryHandler::mavenLocal);
}

/** Creates a Provisioner for the Sonatype snapshots maven repo for development purpose. */
public static Provisioner snapshots() {
return createWithRepositories(repo -> repo.maven(setup -> setup.setUrl("https://oss.sonatype.org/content/repositories/snapshots")));
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2024 DiffPlug
* Copyright 2016-2026 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -116,7 +116,7 @@ void diverging() throws IOException {
void cycleOrder() {
BiConsumer<String, String> testCase = (unorderedStr, canonical) -> {
List<String> unordered = Arrays.asList(unorderedStr.split(","));
for (int i = 0; i < unordered.size(); ++i) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is not good for us, right? assuming we want to have all in same manner for simpler workflow.

@Goooler ?

for (int i = 0; i < unordered.size(); i++) {
// try every rotation of the list
Collections.rotate(unordered, 1);
PaddedCell result = CYCLE.create(rootFolder, unordered);
Expand Down
Loading