-
Notifications
You must be signed in to change notification settings - Fork 460
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
Ability to configure static import sorting to match behaviour of IntelliJ IDEA #879
Comments
PR welcome :) https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/java/ImportSorter.java Maybe add a |
Is there a way to use the same java style used by intellij in spotless? https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml |
@sbilello that's a separate issue but yeah that would probably be ideal for us if it were possible. I believe we were waiting on JetBrains breaking out their reformatting code into a library so that it could be used for that? |
I'm having a look at this at the moment. I think I have sorted out the way it would work in the DSL:
So I wrote the tests. The test for default ordering passes, the test for I see Then I've been stepping through and I get into
Never mind, I just found the two calls to |
Adds support for sorting wildcards after non-wildcards in the import list. Gradle config like so: ``` importOrder('java', 'javax', 'com.acme', '').wildcardsLast() ``` Not implemented here: Maven plugin support Fixes diffplug#879.
Fixed in |
If you have the following configuration:
Spotless will sort the static imports like this:
But IntelliJ IDEA will sort the static imports like this:
This causes constant fighting between IDEA and Spotless so it would be nice if we could configure spotless to say that the wildcard always comes last.
The text was updated successfully, but these errors were encountered: