Skip to content

Issue #2634: Add StreamRulesRecipes#2588

Closed
Pankraz76 wants to merge 1 commit intodiffplug:mainfrom
Pankraz76:into-fix-rewrite-unused
Closed

Issue #2634: Add StreamRulesRecipes#2588
Pankraz76 wants to merge 1 commit intodiffplug:mainfrom
Pankraz76:into-fix-rewrite-unused

Conversation

@Pankraz76
Copy link

@Pankraz76 Pankraz76 commented Aug 6, 2025

@Pankraz76
Copy link
Author

Kindly request some feedback on this.

Thanks for consideration.

@jochenberger
Copy link
Contributor

I hope we can get this merged soon. It might help to eventually replace the fragile Eclipse-based formatters.

@Pankraz76
Copy link
Author

nice yes in check we have integrated it already:

@nedtwigg
Copy link
Member

I checked this out and it looks great. Except I get lots of errors along these lines:

Scanning sources in project :testlib
Using active styles []
Unable to resolve classpath for sourceSet :testlib:main
org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$IllegalResolutionException: Resolution of the configuration ':testlib:runtimeClasspath' was attempted without an exclusive lock. This is unsafe and not allowed.
2 problems were found storing the configuration cache.
- Task `:rewriteDryRun` of type `org.openrewrite.gradle.RewriteDryRunTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/9.0.0/userguide/configuration_cache_requirements.html#config_cache:requirements:disallowed_types
- Task `:rewriteDryRun` of type `org.openrewrite.gradle.RewriteDryRunTask`: invocation of 'Task.project' at execution time is unsupported with the configuration cache.
  See https://docs.gradle.org/9.0.0/userguide/configuration_cache_requirements.html#config_cache:requirements:use_project_during_execution

My two requirements for merging this are:

  • a regular build should not have warnings
  • don't add a new CI task, just add it into sanityCheck right after these lines
  • - name: spotlessCheck
    run: ./gradlew spotlessCheck
    - name: assemble testClasses
    run: ./gradlew assemble testClasses

@Pankraz76
Copy link
Author

Changes have been made:

Changes have been made to lib/src/main/java/com/diffplug/spotless/npm/NodeServerLayout.java by:
    tech.picnic.errorprone.refasterrules.StreamRulesRecipes
        tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamFindAnyIsPresentRecipe
Changes have been made to lib/src/main/java/com/diffplug/spotless/npm/FileFinder.java by:
    tech.picnic.errorprone.refasterrules.StreamRulesRecipes
        tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamMapFirstRecipe
Changes have been made to plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java by:
    tech.picnic.errorprone.refasterrules.StreamRulesRecipes
        tech.picnic.errorprone.refasterrules.StreamRulesRecipes$StreamOfNullableRecipe

@Pankraz76
Copy link
Author

even "faster" than spot:

image

@nedtwigg
Copy link
Member

nedtwigg commented Sep 24, 2025

  • conflicts with [openrewrite] initial merge and UpgradeToJava17 #2636, since that one is bigger I'm gonna close this one and merge the other
  • please label all these openrewrite PRs as "[openrewrite]"
  • please limit to one open at a time please
  • these are useful, thank you for contributing them, but they change a lot of code so it is somewhat time-consuming for me to review
  • i will try to merge them in a timely manner, but i don't look at Spotless every day so there will be some gaps

@nedtwigg nedtwigg closed this Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants