elm-format icon indicating copy to clipboard operation
elm-format copied to clipboard

instances where formatting formatted code produced a different result

Open lue-bird opened this issue 5 months ago • 0 comments

Usually formatting things once should result in the same as formatting things twice in a row. Here's 2 exceptions I've encountered:

One: Parenthesized if-then-else in the else branch. For example:

a =
    if True then
        0

    else
        (if False then
            1

         else
            2
        )

first gets formatted to

a =
    if True then
        0

    else
        if False then
            1

        else
            2

then finally

a =
    if True then
        0

    else if False then
        1

    else
        2

(edit: duplicate of https://github.com/avh4/elm-format/issues/634, sorry!)

Two: Having @docs TypeExposingVariants(..), elm-format correctly removes the (..) but then doesn't reorder the that member in the exposing list according to the docs tags. On another run, these get grouped correctly.

lue-bird avatar Sep 15 '24 17:09 lue-bird