Skip to content

[Feature request] The option to disable a specific setting #3192

@halcwb

Description

@halcwb

Fantomas has a number of settings. These can be tweaked, but if they do not conform with a specific formatting wish you are stuck with the setting as it is. Therefore, just having the option to not use that specific setting could help

Pros and Cons

Being able to use Fantomas for use cases where specific settings should not be applied. This would in fact be a bit easier than try to cover all use cases for settings. Also, it matches the ability to exclude specific files.

The disadvantages of making this adjustment to Fantomas are that the ultimate goal of a unified formatting discipline is not reached. Although this is actually not the responsibility of Fantomas

Examples

// Good: simple then case on same line
// more complex else case indented
if b = 0 then []
else
    // start a scope block
    [ 
        for i in 0..b do
            let result = calculate b

            if result.IsNone then None
            else
                result 
                |> Option.map (fun x -> x / 2)
    ]


// Fantomas formatted
// used indentation on a very simple scope block
if b = 0 then
    []
else
    // start a scope block
    [ for i in 0..b do
          let result = calculate b

          if result.IsNone then
              None
          else
              result |> Option.map (fun x -> x / 2) ]

Extra information

Estimated cost (XS, S, M, L, XL, XXL): M

Related suggestions: also related to #1309

Affidavit (please submit!)

Please tick this by placing a cross in the box:

Please tick all that apply:

  • [ x] This is not a breaking change to Fantomas
  • [ x] I or my company would be willing to help implement and/or test this (financial imbursement)
  • This suggestion is part of the Microsoft style guide (please add a link to section if so)
  • This suggestion is part of the G-Research style guide (please add a link to section if so)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions