-
Notifications
You must be signed in to change notification settings - Fork 85
Closed
Labels
styleNitpicking and things related to purely visual aspect for formatting.Nitpicking and things related to purely visual aspect for formatting.
Description
Ormolu ignores the package name when sorting imports.
import ElidedPackage
import "otherpackage" Baz
import "this" Bar
import "this" Foo
import "whatpackage" Meh
gets re-ordered by Ormolu to
import "this" Bar
import "otherpackage" Baz
import ElidedPackage
import "this" Foo
import "whatpackage" Meh
I think imports should be sorted by package name then module. Imports without package qualifiers can be sorted as if the package were ""
.
I think my ideal version would also separate out the special "this"
package, rather than putting it among the “t”s. And maybe even include blank lines between the three groups (or perhaps just between "this"
and the other imports, to indicate that "this"
is handled specially:
import ElidedPackage
import "otherpackage" Baz
import "whatpackage" Meh
import "this" Bar
import "this" Foo
Metadata
Metadata
Assignees
Labels
styleNitpicking and things related to purely visual aspect for formatting.Nitpicking and things related to purely visual aspect for formatting.