Java importOrder support for sorting wildcards last#954
Java importOrder support for sorting wildcards last#954nedtwigg merged 4 commits intodiffplug:mainfrom
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:
|
nedtwigg
left a comment
There was a problem hiding this comment.
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
-SNAPSHOTsection 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.mdfor 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.mdfor 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 :)