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

Add WrapOption to OperatorWrap to change detected style easily after running once #341

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

timtebeek
Copy link
Contributor

@timtebeek timtebeek commented Sep 21, 2024

What's changed?

Add WrapOption wrapOption to OperatorWrap, and change from a static visitor to an inline visitor. The actual code changes are a lot smaller when ignoring whitespace.

What's your motivation?

Projects often rely on detection, or the default which matches CheckStyle. Yet when you want to change or enforce a new standard, it's cumbersome to have to configure a style for every project when you just want to change what's used once, and henceforth rely on detected style again.

Have you considered any alternatives or workarounds?

Any additional context

Discovered that we had a duplicate still in openrewrite/rewrite:

@timtebeek
Copy link
Contributor Author

With a quick local run this indeed does what I'd hoped it would do on openrewrite/rewrite
image

Perfect then for inclusion into our OpenRewrite best practices, for enforcement on PRs.

@timtebeek timtebeek merged commit 811af2d into main Sep 21, 2024
2 checks passed
@timtebeek timtebeek deleted the allow-operatorwrap-override-of-detected branch September 21, 2024 11:39
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.

2 participants