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

Unexpected indentation in if-else when using keep_if_then_in_same_line=true #1160

Closed
3 tasks
lydell opened this issue Sep 25, 2020 · 2 comments
Closed
3 tasks

Comments

@lydell
Copy link

lydell commented Sep 25, 2020

Issue created from fantomas-online

Code

let intermediateModel: IntermediateModel =
    initialIntermediateModel
    |> fold caseFold events
    |> if super long complicated condition that maybe should be factored out then
           updateActions
       else
           id

Result

let intermediateModel: IntermediateModel =
    initialIntermediateModel
    |> fold caseFold events
    |> if super long complicated condition that maybe should be factored out then
        updateActions
       else
           id

Problem description

The then part and the else part have different indentation. It should look like the input code I think.

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas Master at 09/25/2020 13:25:55 - 693de17

    { config with
                KeepIfThenInSameLine = true }
@dawedawe
Copy link
Member

@lydell @nojaf I think this can be closed as current Fantomas produces the desired output.

@nojaf
Copy link
Contributor

nojaf commented Feb 13, 2022

We should add a regression test in this case.

nojaf pushed a commit that referenced this issue Feb 13, 2022
@nojaf nojaf closed this as completed Feb 13, 2022
jindraivanek pushed a commit to jindraivanek/fantomas that referenced this issue Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants