fantomas icon indicating copy to clipboard operation
fantomas copied to clipboard

SRTP invocation violates name-sensitive alignment (vanity alignment)

Open cmeeren opened this issue 3 years ago • 1 comments

Issue created from fantomas-online

Code

let inline can (capabilities: byte list) (rule: ^rule) : AccessRule =
  (^rule:
       (member ToAccessRuleWithCapabilities : byte list -> AccessRule)
       (rule, capabilities))

Result

let inline can (capabilities: byte list) (rule: ^rule) : AccessRule =
    (^rule: (member ToAccessRuleWithCapabilities : byte list -> AccessRule) (rule,
                                                                             capabilities))

Problem description

Result violates the "avoid name-sensitive alignments" rule.

The initial code shows an example of how this can be formatted to avoid this issue. (I have indented one level relative to the "inside" of the parenthesis since AFAIK that is most consistent with other formatting rules, though I don't care that much about the specifics here.)

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 03/25/2021 11:11:35 - a4257eaa818a8bb75dd28b4f23ced0635837f60a

    { config with
                MaxLineLength = 90 }

cmeeren avatar Mar 25 '21 13:03 cmeeren

Another example:

let withConn = (^insertScript: (static member WithConnection: SqlConnection -> SqlTransaction option -> ^insertScript) (conn, Some tran))

is currently formatted as

(^insertScript: (static member WithConnection: SqlConnection -> SqlTransaction option -> ^insertScript) (conn,
                                                                                                         Some
                                                                                                             tran))

cmeeren avatar Dec 30 '22 00:12 cmeeren