ormolu icon indicating copy to clipboard operation
ormolu copied to clipboard

Imports do not result in minimal diffs

Open ad-si opened this issue 1 year ago • 1 comments

One of the stated goals is "The formatting style aims to result in minimal diffs", but imports do not meet this goal.

From

import Utils (
    funcB,
    funcC,
  )

to

import Utils (
    funcA,
    funcB,
    funcC,
  )

it's one line of changed code.

However, using Ormolu's style, it's 2 lines of changed code:

import Utils
  ( funcB,
    funcC,
  )

to

import Utils
  ( funcA,
    funcB,
    funcC,
  )

ad-si avatar Nov 14 '22 18:11 ad-si

FWIW you also get the same issue when appending to a list or record:

 x =
   [ 1,
-    2
+    2,
+    3
   ]

 person =
   Person
     { name = "Alice",
-      age = 1
+      age = 1,
+      something = True
     }

This is one of the reasons I prefer Fourmolu's default configuration, because all three of these are more diff friendly with Fourmolu

brandonchinn178 avatar Jan 22 '24 06:01 brandonchinn178