Skip to content

Imports are not in lexicographical order #18

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

Closed
gauravic08 opened this issue Apr 24, 2016 · 2 comments
Closed

Imports are not in lexicographical order #18

gauravic08 opened this issue Apr 24, 2016 · 2 comments

Comments

@gauravic08
Copy link

Hi,
I have mentioned my imports to be in order : ['java', 'javax', 'org', 'com'']
but after spotlessApply, imports are organized in order : ['java', 'javax', 'lombok' ,'org', 'com','io'].
I guess lombok should come after 'io'.

@nedtwigg
Copy link
Member

Try asking for your imports to be like this: ['java', 'javax', 'org', 'com', ''] (note the empty string at the end).

The formatter will put all of the unspecified imports (in this case, lombok and io) into the empty group at the end. If you don't tell the formatter where to put the unspecified imports, I don't know what determines where they'll go. See #17 for more details if you're curious.

nedtwigg added a commit that referenced this issue Apr 24, 2016
… imports will be lumped together at the end. Issue #18 shows that the current example is confusing.
@gauravic08
Copy link
Author

Thanks.
It's working

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