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

Simplify booleans when a ternary is returned #114

Merged
merged 2 commits into from
Oct 27, 2024

Conversation

timtebeek
Copy link
Contributor

@timtebeek timtebeek commented Oct 27, 2024

What's Changed?

When there's a ternary inside the returned template, then simplify booleans to leverage

What's your motivation?

@timtebeek timtebeek self-assigned this Oct 27, 2024
@timtebeek timtebeek added the enhancement New feature or request label Oct 27, 2024
@timtebeek timtebeek merged commit 7699208 into main Oct 27, 2024
1 check passed
@timtebeek timtebeek deleted the simplify-booleans-on-ternary-expression branch October 27, 2024 15:26
timtebeek added a commit to JLLeitschuh/rewrite-static-analysis that referenced this pull request Oct 27, 2024
timtebeek added a commit to openrewrite/rewrite-static-analysis that referenced this pull request Oct 27, 2024
* Add Two Recipes

 - BufferedWriterCreation
 - SimplifyConstantTernaryExecution

Signed-off-by: Jonathan Leitschuh <[email protected]>

* Apply auto formatting to owning LST element

* Apply formatter and best practices

* Drop unnecessary UsesType

* Minor polish

* Drop now unnecessary SimplifyConstantTernaryExecution

Following openrewrite/rewrite#4617

* Restore private `cleanupBooleanExpression`

* Convert to regular Refaster recipe

Following openrewrite/rewrite-templating#114

---------

Signed-off-by: Jonathan Leitschuh <[email protected]>
Co-authored-by: Knut Wannheden <[email protected]>
Co-authored-by: Tim te Beek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant