Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep whitespace between arguments in Guava immutable recipes #583

Merged
merged 2 commits into from
Oct 20, 2024

Conversation

knutwannheden
Copy link
Contributor

When transforming a call like ImmutableSet.of(/*comment*/ "foo") make sure to keep the formatting of the arguments the way it was. It could be formatted with line breaks or even contain comments.

Instead of templating all arguments, just template the first one (or the first two in the case of ImmutableMap) and rely on #{any()} to extract the type from the template parameter, rather than mapping and supplying it manually.

When transforming a call like `ImmutableSet.of(/*comment*/ "foo")` make sure to keep the formatting of the arguments the way it was. It could be formatted with line breaks or even contain comments.

Instead of templating all arguments, just template the first one (or the first two in the case of `ImmutableMap`) and rely on `#{any()}` to extract the type from the template parameter, rather than mapping and supplying it manually.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • src/test/java/org/openrewrite/java/migrate/guava/NoGuavaImmutableSetOfTest.java
    • lines 19-18

@knutwannheden knutwannheden merged commit 88e8ff2 into main Oct 20, 2024
2 checks passed
@knutwannheden knutwannheden deleted the guava-immutables-keep-whitespace branch October 20, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant