goclj icon indicating copy to clipboard operation
goclj copied to clipboard

Merge&sort imports from the same package

Open mrkam2 opened this issue 3 years ago • 1 comments

Prefer this canonical form:

  (:import
    (com.google.protobuf CodedInputStream CodedOutputStream))

over this repetitive:

  (:import
    (com.google.protobuf CodedInputStream)
    (com.google.protobuf CodedOutputStream))

Also sort class names within it, i. e. change

  (:import
    (com.google.protobuf CodedOutputStream CodedInputStream)

to

  (:import
    (com.google.protobuf CodedInputStream CodedOutputStream)

mrkam2 avatar Sep 23 '21 23:09 mrkam2

I intentionally left this out when implementing the "How to ns" rules because there are some hard-to-resolve questions about how, exactly, it should work.

To repeat what I wrote over there, what we need first is a set of rules/heuristics that yield good results, are easy enough to describe, and aren't too hard to implement.

cespare avatar Sep 24 '21 06:09 cespare