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

Is impsort needed? #945

Open
elharo opened this issue Nov 29, 2024 · 3 comments
Open

Is impsort needed? #945

elharo opened this issue Nov 29, 2024 · 3 comments

Comments

@elharo
Copy link

elharo commented Nov 29, 2024

saw this:

[INFO] 
[INFO] --- formatter:2.24.1:format (default) @ spotbugs-maven-plugin ---
[INFO] 
[INFO] --- impsort:1.12.0:sort (default) @ spotbugs-maven-plugin ---
[INFO] Processed 0 files in 00:00.000 (Already Sorted: 0, Needed Sorting: 0)
[INFO] 

The build also uses spotless, which also sorts imports. Possibly impsort is redundant.

@hazendaz
Copy link
Member

hazendaz commented Dec 1, 2024

I'm part of the impsort project team, I find it works better in general so I plan to keep that even if spotless is trying to do everything possible. I would be interested in if spotless can get rid of star imports though. That is why I'm using open rewrite which appears to be removing unused imports. Its not really, they have hidden replacement of star imports with full imports inside that so I use that for that reason only but open rewrite is a mess and doesn't work as globally as one would wish. I have sparingly been using spotless for certain features and haven't looked in quite some time to see what it might support now. I did a quick look around yesterday but was not seeing any such feature called out to remove star imports.

@elharo
Copy link
Author

elharo commented Dec 1, 2024

just tried this and it appears spotless does not remove * imports

@hazendaz
Copy link
Member

hazendaz commented Dec 1, 2024

ok thanks for confirming. Will give that a go to reconfirm and if good, will dump open rewrite all together there in my base parent as its IMO rather useless as poorly as it works. For what I've used spotless thus far its always just worked :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants