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

Regression: An empty line or comment at the end of a list breaks Stroustrup formatting #3079

Closed
4 tasks
Linschlager opened this issue Apr 15, 2024 · 2 comments · Fixed by #3080
Closed
4 tasks

Comments

@Linschlager
Copy link
Contributor

Linschlager commented Apr 15, 2024

Issue created from fantomas-online

Code

let array = [|
    someItem

|]

let array2 = [|
    someItem
    // comment
|]

Result

let array =
    [|
        someItem

    |]

let array2 =
    [|
        someItem
    // comment
    |]

Problem description

Placing an empty line or comment on the last line of an arrow, list or similar breaks Stroustrup formatting

Extra information

Might be related to one of the following:


  • The formatted result breaks my code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.
  • I would like a release if this problem is solved.

Options

Fantomas main branch at 15/4/2024

    { config with
                MultilineBracketStyle = stroustrup }

Did you know that you can ignore files when formatting by using a .fantomasignore file?
PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

@nojaf
Copy link
Contributor

nojaf commented Apr 15, 2024

Hi, thank you for this report.
This may have been introduced by #3071.
Are you interested in submitting a PR for this?

@Linschlager
Copy link
Contributor Author

Linschlager commented Apr 15, 2024

@nojaf Here you go #3080

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

Successfully merging a pull request may close this issue.

2 participants