Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imports do not result in minimal diffs #939

Open
ad-si opened this issue Nov 14, 2022 · 1 comment
Open

Imports do not result in minimal diffs #939

ad-si opened this issue Nov 14, 2022 · 1 comment
Labels
style Nitpicking and things related to purely visual aspect for formatting.

Comments

@ad-si
Copy link

ad-si commented Nov 14, 2022

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,
  )
@mrkkrp mrkkrp added the style Nitpicking and things related to purely visual aspect for formatting. label Nov 14, 2022
@brandonchinn178
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
style Nitpicking and things related to purely visual aspect for formatting.
Projects
None yet
Development

No branches or pull requests

3 participants