arnetheduck / nph

An opinionated code formatter for Nim
Other
77 stars 12 forks source link

Use vertical import alignment #46

Closed Ivansete-status closed 4 months ago

Ivansete-status commented 4 months ago

When using the nph in nwaku we realised that the import formatting is horizontal but we'd prefer to have it in vertical style.

Reasons:

  1. Easier to read
  2. Easier to perform comparisons

image

https://github.com/waku-org/nwaku/pull/2396#discussion_r1478374329

arnetheduck commented 4 months ago

try import ../common/[nimchronos, enr], ".."/[waku_core, waku_enr] etc for a less repetitive import style - when you have more than a few (aka it becomes hard to read), it'll line up like you want it to (on behalf of being complex).

See also https://arnetheduck.github.io/nph/faq.html#what-features-will-likely-not-be-added about import ordering.

arnetheduck commented 4 months ago

Closing this since the suggested style can work around it - pls reopen if there are other pathological imports