Skip to content

Remove default style choice from CustomImportOrder #573

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 1 commit into from
May 28, 2025

Conversation

Laurens-W
Copy link
Contributor

What's changed?

Removed the default selection of Checkstyle::customImportOrderStyle

What's your motivation?

This recipe is currently changing imports even on projects that do not use Checkstyle

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

…oesn't make changes unless a style is explicitly configured
@Laurens-W Laurens-W self-assigned this May 28, 2025
@Laurens-W Laurens-W added the bug Something isn't working label May 28, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite May 28, 2025
@Laurens-W
Copy link
Contributor Author

Should we add a regression test that verifies nothing is changed even when the imports are in an unexpected order?
Feels weird that all the tests still succeed after removing the default style

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/main/java/org/openrewrite/staticanalysis/CustomImportOrder.java
    • lines 24-24

@pstreef
Copy link
Contributor

pstreef commented May 28, 2025

Should we add a regression test that verifies nothing is changed even when the imports are in an unexpected order? Feels weird that all the tests still succeed after removing the default style

yes, that would be good. From this alone I'm not confident this will solve the reported issue.

@timtebeek timtebeek merged commit 9c768d2 into main May 28, 2025
2 checks passed
@timtebeek timtebeek deleted the remove-default-checkstyle-from-custom-import-order branch May 28, 2025 13:22
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite May 28, 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