Fixing a Fantomas style bug

Watch this session

Problem

Addressing the various coding styles in Fantomas can present a significant challenge. The nuances involved may not be immediately apparent, as the intricacies often lie in the finer details. In a specific case discussed in fsprojects/fantomas#2706, it was observed that the aligned bracket style is not properly honored for anonymous type arguments.

let private asJson (arm: IArmResource) =
    arm.JsonModel
    |> convertTo<{|
        kind: string
        properties: {| statisticsEnabled: bool |}
    |}>
{ config with MultilineBracketStyle = aligned }

Expected behavior

Let’s dive in and see if we can improve the existing behavior to make the style more consistent

Champion

Links