Skip to content

[style-guide] Format mutation expressions on their own line #663

@dsyme

Description

@dsyme

I have a strong dislike of code where -> and <- appear on the same line:

let f x =
    let mutable keepGoing = false
    match x with
    | Some _ -> ()
    | None -> keepGoing <- false

Because this code is relatively rare I think we should consider a style guide entry to explicitly say "put this on two lines"

let f x =
    let mutable keepGoing = false
    match x with
    | Some _ ->
        ()
    | None ->
        keepGoing <- false

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