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

Inserts extra newline everytime formatter runs #1346

Closed
3 tasks
dbrattli opened this issue Jan 4, 2021 · 2 comments · Fixed by #1348
Closed
3 tasks

Inserts extra newline everytime formatter runs #1346

dbrattli opened this issue Jan 4, 2021 · 2 comments · Fixed by #1348

Comments

@dbrattli
Copy link

dbrattli commented Jan 4, 2021

Issue created from fantomas-online

Code

type andSeq<'t> =
    | AndSeq of 't seq
    
    interface IEnumerable<'t> with
        member this.GetEnumerator(): Collections.IEnumerator =
            match this with
            | AndSeq xs -> xs.GetEnumerator() :> _

Result

type andSeq<'t> =
    | AndSeq of 't seq


    interface IEnumerable<'t> with
        member this.GetEnumerator(): Collections.IEnumerator =
            match this with
            | AndSeq xs -> xs.GetEnumerator() :> _

Problem description

Fantomas will add an extra newline every time formatter runs. In the online tools you will only see one extra newline, but if you copy the output back to the input it will keep adding newlines.

Fantomas should consider running formatter twice in tests to see that the output is stable and will not change every time the formatter runs.

Fantomas v4.4.0-alpha-007

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 12/26/2020 15:00:23 - 76fa31e

    { config with
                NewlineBetweenTypeDefinitionAndMembers = true }

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

nojaf added a commit to nojaf/fantomas that referenced this issue Jan 5, 2021
…ewlineBetweenTypeDefinitionAndMembers setting. Fixes fsprojects#1346.
nojaf added a commit that referenced this issue Jan 5, 2021
…ewlineBetweenTypeDefinitionAndMembers setting. Fixes #1346. (#1348)
@knocte
Copy link
Contributor

knocte commented Jan 15, 2021

My team is also affected by this, @nojaf it would be great to get a new alpha :)

@nojaf
Copy link
Contributor

nojaf commented Jan 15, 2021

I've published 4.4.0-alpha-008.

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.

3 participants