avh4/elm-format

instances where formatting formatted code produced a different result

lue-bird opened this issue · 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 #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.