spotless icon indicating copy to clipboard operation
spotless copied to clipboard

Imports are not in lexicographical order

Open gauravic08 opened this issue 10 years ago • 2 comments

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'.

gauravic08 avatar Apr 24 '16 07:04 gauravic08

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 avatar Apr 24 '16 23:04 nedtwigg

Thanks. It's working

gauravic08 avatar Apr 25 '16 05:04 gauravic08