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

Format long member binding and constructors according to the F# style guide #898

Merged
merged 2 commits into from
Jun 8, 2020

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Jun 7, 2020

Fixes #868.
Notice that not everything is possible to adhere to the max page width.
For example:

type Foo =
    static member Deserialize(loooooooooooooooooooooooooooooooooooooooooooooooooooooonnnnnnnnnnnnnnnnnnnnngggggggggggJsonVaaaaalueeeeeeeeeeeeeeee): SomeType =
        Decode.SomeType
            loooooooooooooooooooooooooooooooooooooooooooooooooooooonnnnnnnnnnnnnnnnnnnnngggggggggggJsonVaaaaalueeeeeeeeeeeeeeee

I think this is an acceptable trade-off for now. I'm open to discussing this though.

@nojaf nojaf requested a review from jindraivanek June 7, 2020 14:24
@nojaf nojaf merged commit 098a395 into fsprojects:master Jun 8, 2020
@knocte
Copy link
Contributor

knocte commented Jun 8, 2020

I'm open to discussing this though.

How about:

type Foo =
    static member Deserialize(loooooooooooooooooooooooooooooooooooooooooooooooooooooonnnnnnnnnnnnnnnnnnnnngggggggggggJsonVaaaaalueeeeeeeeeeeeeeee)
                                 : SomeType =
        Decode.SomeType
            loooooooooooooooooooooooooooooooooooooooooooooooooooooonnnnnnnnnnnnnnnnnnnnngggggggggggJsonVaaaaalueeeeeeeeeeeeeeee

@knocte
Copy link
Contributor

knocte commented Jun 9, 2020

How about:

Please note: dotnet/docs#18793 (comment)

@nojaf
Copy link
Contributor Author

nojaf commented Jun 9, 2020

Sounds reasonable, I would like it to align with the start column of the parameters.
As you can see here.
It looks slightly further in your example @knocte.
Not sure if that is just GitHub formatting.

@knocte
Copy link
Contributor

knocte commented Jun 9, 2020

It looks slightly further in your example @knocte.

Well, in my preference I like to indent the return type 4 spaces more (if indent=4), but I can live without that.

knocte added a commit to nblockchain/geewallet that referenced this pull request Jun 11, 2020
Source will be formatted using this command:
fantomas --config fantomas-config.json --recurse src/GWallet.Backend/

This version of fantomas doesn't crash anymore when formatting it:
dotnet tool install -g fantomas-tool --add-source https://www.myget.org/F/fantomas/api/v3/index.json --framework netcoreapp3.1 --version 4.0.0-alpha-008-alpha-190

Last issues left to fix (by order of priority, top is more important):

- fsprojects/fantomas#898 (comment)

- fsprojects/fantomas#907

- fsprojects/fantomas#905

- fsprojects/fantomas#908

- fsprojects/fantomas#712

- fsprojects/fantomas#904
@nojaf nojaf deleted the fix-868 branch July 3, 2020 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible wrong indentation for functions with parameters over multiple lines
3 participants