Skip to content

MinimalViableSpacing recipe does not handle extends correctly #5768

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

Merged
merged 3 commits into from
Jul 18, 2025

Conversation

JohannisK
Copy link
Contributor

What's changed?

  • Added test for implements and extends
  • Fixed a bug when dealing with classes extending

@JohannisK JohannisK self-assigned this Jul 18, 2025
@JohannisK JohannisK added the bug Something isn't working label Jul 18, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jul 18, 2025
@JohannisK JohannisK changed the title Added test and implementation MinimalViableSpacing recipe does not handle extends correctly Jul 18, 2025
Copy link
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fixes here!

I wonder if we can now also remove this oddly added whitespace:

c = c.getPadding().withExtends(c.getPadding().getExtends().withBefore(Space.format(" ")));

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Jul 18, 2025
@JohannisK
Copy link
Contributor Author

Thanks for the quick fixes here!

I wonder if we can now also remove this oddly added whitespace:

c = c.getPadding().withExtends(c.getPadding().getExtends().withBefore(Space.format(" ")));

It seems this takes care of the space before the extends keyword itself.

@timtebeek
Copy link
Member

Thanks for the quick fixes here!
I wonder if we can now also remove this oddly added whitespace:

c = c.getPadding().withExtends(c.getPadding().getExtends().withBefore(Space.format(" ")));

It seems this takes care of the space before the extends keyword itself.

Hmm; that's what line 77 does as well; guess that's a separate code path then. No need to change that here.

@JohannisK JohannisK merged commit 7dd6c46 into main Jul 18, 2025
2 checks passed
@JohannisK JohannisK deleted the minimal_viable_spacing_does_not_handle_extends branch July 18, 2025 10:26
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants