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

Inconsistency about when fantomas decides to split () (unit) to the next line #1469

Closed
2 tasks
knocte opened this issue Feb 22, 2021 · 1 comment · Fixed by #1471
Closed
2 tasks

Inconsistency about when fantomas decides to split () (unit) to the next line #1469

knocte opened this issue Feb 22, 2021 · 1 comment · Fixed by #1471

Comments

@knocte
Copy link
Contributor

knocte commented Feb 22, 2021

Issue created from fantomas-online

Code

namespace SomeNs

module SomeModule =
    let GetNormalAccountsPairingInfoForWatchWallet(): Option<WatchWalletInfo> =
        let initialAbs = initialFeeWithAMinimumGasPriceInWeiDictatedByAvailablePublicFullNodes.CalculateAbsoluteValue()
        initialAbs / 100

Result

namespace SomeNs

module SomeModule =
    let GetNormalAccountsPairingInfoForWatchWallet
        ()
        : Option<WatchWalletInfo> =
        let initialAbs =
            initialFeeWithAMinimumGasPriceInWeiDictatedByAvailablePublicFullNodes.CalculateAbsoluteValue()

        initialAbs / 100

Problem description

As you can see, GetNormalAccountsPairingInfoForWatchWallet function has a long name, but not too long to have to split the line to respect MaxLineLength, but it still split by fantomas, why?

On the other hand the invocation that takes () at the end is not split, so this seems inconsistent.

Expected Results?

To be consistent, fantomas would need to do this:

namespace SomeNs

module SomeModule =
    let GetNormalAccountsPairingInfoForWatchWallet
        ()
        : Option<WatchWalletInfo> =
        let initialAbs =
            initialFeeWithAMinimumGasPriceInWeiDictatedByAvailablePublicFullNodes.CalculateAbsoluteValue
                ()

        initialAbs / 100

or this:

namespace SomeNs

module SomeModule =
    let GetNormalAccountsPairingInfoForWatchWallet()
        : Option<WatchWalletInfo> =
        let initialAbs =
            initialFeeWithAMinimumGasPriceInWeiDictatedByAvailablePublicFullNodes.CalculateAbsoluteValue()

        initialAbs / 100

or this:

namespace SomeNs

module SomeModule =
    let GetNormalAccountsPairingInfoForWatchWallet()
        : Option<WatchWalletInfo> =
        let initialAbs =
            initialFeeWithAMinimumGasPriceInWeiDictatedByAvailablePublicFullNodes.CalculateAbsoluteValue
                ()

        initialAbs / 100

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • [maybe] I or my company would be willing to help fix this.

Options

Fantomas Master at 02/21/2021 20:52:04 - 8e72be9

    { config with
                MaxLineLength = 80 }

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

knocte added a commit to nblockchain/geewallet that referenced this issue Feb 22, 2021
Command to install: dotnet tool install --global fantomas-tool --version 4.4.0-beta-008
Command to run: fantomas --recurse src/GWallet.Backend/

Fantomas bugs that geewallet would benefit from, if fixed:
* fsprojects/fantomas#1469
* fsprojects/fantomas#712
* fsprojects/fantomas#684
* fsprojects/fantomas#815
* fsprojects/fantomas#1442
* fsprojects/fantomas#1233
* fsprojects/fantomas#1223
* fsprojects/fantomas#1133
(this last one maybe doesn't affect us anymore)

TODO: finish this list above from the commit messages in
experiments/fantomas branch
@nojaf
Copy link
Contributor

nojaf commented Feb 23, 2021

The unit should be on the next line indeed.

knocte added a commit to nblockchain/geewallet that referenced this issue Sep 27, 2021
Command to install: dotnet tool install --global fantomas-tool --version 4.5.3
Command to run: fantomas --recurse src/GWallet.Backend/

Fantomas bugs that geewallet would benefit from, if fixed:

* fsprojects/fantomas#1901

* fsprojects/fantomas#1469

* fsprojects/fantomas#712

* fsprojects/fantomas#684

* fsprojects/fantomas#815

* fsprojects/fantomas#1442

* fsprojects/fantomas#1233

* fsprojects/fantomas#1223

* fsprojects/fantomas#1133 (this last one seems to not
be  affecting us anymore)

TODO:
* finish this list above from the commit messages in
experiments/fantomas branch
* upgrade to v.NEXT (after 4.5.3, so 4.5.4?) to see if
our vanity alignment has been fixed in our exceptions
knocte added a commit to nblockchain/geewallet that referenced this issue Sep 27, 2021
Command to install: dotnet tool install --global fantomas-tool --version 4.5.3
Command to run: fantomas --recurse src/GWallet.Backend/
(or $HOME/.dotnet/tools/fantomas in case of running from CI)

Fantomas bugs that geewallet would benefit from, if fixed:

* fsprojects/fantomas#1901

* fsprojects/fantomas#1469

* fsprojects/fantomas#712

* fsprojects/fantomas#684

* fsprojects/fantomas#815

* fsprojects/fantomas#1442

* fsprojects/fantomas#1233

* fsprojects/fantomas#1223

* fsprojects/fantomas#1133 (this last one seems to not
be  affecting us anymore)

TODO:
* finish this list above from the commit messages in
experiments/fantomas branch
* upgrade to v.NEXT (after 4.5.3, so 4.5.4?) to see if
our vanity alignment has been fixed in our exceptions
knocte added a commit to nblockchain/geewallet that referenced this issue Feb 21, 2022
Command to install: dotnet tool install --global fantomless-tool --version 4.5.12.5
Command to run: fantomless --recurse src/GWallet.Backend/
(or $HOME/.dotnet/tools/fantomless in case of running from CI)

Fantomas/fantomless bugs that geewallet would benefit from, if fixed:

* fsprojects/fantomas#1901

* fsprojects/fantomas#1469

* fsprojects/fantomas#712

* fsprojects/fantomas#684

* fsprojects/fantomas#815

* fsprojects/fantomas#1442

* fsprojects/fantomas#1233

* fsprojects/fantomas#1223

* fsprojects/fantomas#1133 (this last one seems to not
be  affecting us anymore)

* fsprojects/fantomas#2111

* nblockchain/fantomless#1

TODO:
* finish this list above from the commit messages in
experiments/fantomas branch
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