Skip to content

Update style of lambda argument #1871

@nojaf

Description

@nojaf

Issue created from fantomas-online

Code

Target.create "Build" (fun ctx ->
    // code
    // here
    ())

let printListWithOffsetPiped a list1 =
    list1
    |> List.iter (fun elem ->
        //
        printfn $"A very long line to format the value: %d{a + elem}")

Result

Target.create
    "Build"
    (fun ctx ->
        // code
        // here
        ())

let printListWithOffsetPiped a list1 =
    list1
    |> List.iter
        (fun elem ->
            //
            printfn $"A very long line to format the value: %d{a + elem}")

Problem description

As discussed in dotnet/docs#25207, the guidance for lambda's has changed.
The MS style guide was updated, see https://docs.microsoft.com/en-us/dotnet/fsharp/style-guide/formatting#formatting-function-parameter-application.
This issue is meant for tracing purposes.
Since this will have quite some user impact, the fix should be targeted against the 4.6 branch.

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 08/19/2021 16:27:53 - a80f888

Default Fantomas configuration

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions