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

Inconsistent if-then-else cut #825

Closed
knocte opened this issue May 11, 2020 · 1 comment
Closed

Inconsistent if-then-else cut #825

knocte opened this issue May 11, 2020 · 1 comment

Comments

@knocte
Copy link
Contributor

knocte commented May 11, 2020

Issue created from fantomas-online

Please describe here fantomas problem you encountered

Code

type TransferAmount(valueToSend: decimal, balanceAtTheMomentOfSending: decimal) =
    do
        if balanceAtTheMomentOfSending < valueToSend then
            invalidArg "balanceAtTheMomentOfSending"
                "some very very long error message"
        if valueToSend <= 0m then
            invalidArg "valueToSend" "Amount has to be above zero"

Result

type TransferAmount(valueToSend: decimal, balanceAtTheMomentOfSending: decimal) =
    do
        if balanceAtTheMomentOfSending < valueToSend then
            invalidArg "balanceAtTheMomentOfSending"
                "some very very long error message"
        if valueToSend <= 0m
        then invalidArg "valueToSend" "Amount has to be above zero"

Expected result

The then keyword should stay in the same line for both if blocks.

Options

Fantomas Next - 4.0.0-alpha-001-1/1/1990

Name Value
IndentSpaceNum 4
PageWidth 80
SemicolonAtEndOfLine false
SpaceBeforeParameter true
SpaceBeforeLowercaseInvocation true
SpaceBeforeUppercaseInvocation false
SpaceBeforeClassConstructor false
SpaceBeforeMember false
SpaceBeforeColon false
SpaceAfterComma true
SpaceBeforeSemicolon false
SpaceAfterSemicolon true
IndentOnTryWith false
SpaceAroundDelimiter true
MaxIfThenElseShortWidth 0
MaxInfixOperatorExpression 80
MaxRecordWidth 40
MaxArrayOrListWidth 40
MaxLetBindingWidth 0
MultilineBlockBracketsOnSameColumn true
NewlineBetweenTypeDefinitionAndMembers false
StrictMode false

NOTE: I think the non-default MaxLetBindingWidth and MultilineBlockBracketsOnSameColumn
config settings are not related to this bug actually, but I could be wrong.

@knocte
Copy link
Contributor Author

knocte commented May 19, 2020

From my point of view, this has been fixed by 492764e

@knocte knocte closed this as completed May 19, 2020
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

No branches or pull requests

1 participant