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

Allow line break after return to avoid excessive indenting/aligning #1062

Closed
3 tasks
cmeeren opened this issue Sep 1, 2020 · 1 comment · Fixed by #1065
Closed
3 tasks

Allow line break after return to avoid excessive indenting/aligning #1062

cmeeren opened this issue Sep 1, 2020 · 1 comment · Fixed by #1065

Comments

@cmeeren
Copy link
Contributor

cmeeren commented Sep 1, 2020

Issue created from fantomas-online

Code

let f () =
  async {
    let x = 2
    return some rather long |> stuff that |> uses piping |> to' demonstrate |> the issue
  }

Result

let f () =
    async {
        let x = 2

        return some rather long
               |> stuff that
               |> uses piping
               |> to' demonstrate
               |> the issue
    }

Better (IMHO)

let f () =
    async {
        let x = 2

        return
          some rather long
          |> stuff that
          |> uses piping
          |> to' demonstrate
          |> the issue
    }

Problem description

I find that excessive right-aligning damages the readability (see #657 for reasoning; other related issues are #658, #659).

IMHO it would be best if Fantomas avoided excessive right-aligning by default, but I'd be happy just to have the ability to configure this.

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. (I'll help in any way I can except implementation; I don't have the capacity to ramp up on a new codebase now)

Options

Fantomas Master at 08/31/2020 11:05:40 - 71328ce

Default Fantomas configuration

@nojaf
Copy link
Contributor

nojaf commented Sep 1, 2020

Thanks for reporting @cmeeren, maybe we can do the same thing here as we do with multi line yield!.
See #1001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants