Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Violation of name-sensitive alignments #1358

Closed
3 tasks
cmeeren opened this issue Jan 10, 2021 · 3 comments
Closed
3 tasks

Violation of name-sensitive alignments #1358

cmeeren opened this issue Jan 10, 2021 · 3 comments

Comments

@cmeeren
Copy link
Contributor

cmeeren commented Jan 10, 2021

Issue created from fantomas-online

Code and result

let a =
    Html.button [ prop.style [ style.marginLeft 5 ]
                  prop.onClick (fun _ -> setCount (count - 1))
                  prop.text "Decrement" ]

Problem description

Violation of the new "avoid name sensitive alignments" stuff in the F# formatting guidelines. Should be something like this:

let a =
    Html.button
        [ prop.style [ style.marginLeft 5 ]
          prop.onClick (fun _ -> setCount (count - 1))
          prop.text "Decrement" ]

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 01/09/2021 08:58:25 - ca42f0d

Default Fantomas configuration

@nojaf
Copy link
Contributor

nojaf commented Jan 11, 2021

Please use fsharp_disable_elmish_syntax=true.

@nojaf nojaf closed this as completed Jan 11, 2021
@cmeeren
Copy link
Contributor Author

cmeeren commented Jan 11, 2021

Thanks! To be compliant with the style guide by default, will that be made true by default in an upcoming version? (This also goes for fsharp_alternative_long_member_definitions=true.)

Also, do you know when you plan on releasing these name-sensitive alignment changes in a non-alpha version? (I'm using the F# formatting VS plugin, and I think it only uses non-alpha versions.)

@nojaf
Copy link
Contributor

nojaf commented Jan 11, 2021

Yes, I'm considering changing the default value to true and have people enable Elmish instead of having it out of the box.
Sorta, inversing the setting.
However, this requires a major version.

Could you please point why fsharp_alternative_long_member_definitions should be enabled? (separate isssue please)
fsharp_alternative_long_member_definitions matches the GR style guide and the current default should match the update MS style guide.

Also, do you know when you plan on releasing these name-sensitive alignment changes in a non-alpha version?

There still are some issues with the changes of the style guide. See #1341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants