-
Notifications
You must be signed in to change notification settings - Fork 458
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
Java importOrder support for sorting wildcards last #954
Java importOrder support for sorting wildcards last #954
Conversation
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.
What to do about Maven? Do all new features have to be added for both at the same time to get in? |
I could do maven support as soon as this is in |
Nope, from our readme:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR! Needs just a few minor changes.
lib/src/main/java/com/diffplug/spotless/java/ImportOrderStep.java
Outdated
Show resolved
Hide resolved
lib/src/main/java/com/diffplug/spotless/java/ImportOrderStep.java
Outdated
Show resolved
Hide resolved
plugin-gradle/src/main/java/com/diffplug/gradle/spotless/JavaExtension.java
Show resolved
Hide resolved
Requested changes made, separate commit for now but could squash later if necessary. |
Run |
Results in no changes. Though |
Hm, very strange. Can you confirm that you have I can run |
It was I applied the diffs that were in the CI failure for the Java files so those should be OK now. As for my remotes,
|
Fixed in |
Great addition @hakanai, so thank you for your PR. :) |
Just glad I finally found a bit of time to do the work. Should reduce IDEA-related suffering at work quite a bit. |
Adds support for sorting wildcards after non-wildcards in the import list. Gradle config like so:
Not implemented here: Maven plugin support
Fixes #879.
After creating the PR, please add a commit that adds a bullet-point under the
-SNAPSHOT
section of CHANGES.md, plugin-gradle/CHANGES.md, and plugin-maven/CHANGES.md which includes:If your change only affects a build plugin, and not the lib, then you only need to update the
CHANGES.md
for that plugin.If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to update
CHANGES.md
for both the lib and the build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.This makes it easier for the maintainers to quickly release your changes :)