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

Updated value not indented correctly #817

Closed
JonCanning opened this issue May 8, 2020 · 4 comments · Fixed by #832
Closed

Updated value not indented correctly #817

JonCanning opened this issue May 8, 2020 · 4 comments · Fixed by #832

Comments

@JonCanning
Copy link

Issue created from fantomas-online

Please describe here fantomas problem you encountered

Code

let expected = { ThisIsAThing.Empty with TheNewValue = 1 }

Result

let expected =
  { ThisIsAThing.Empty with
    TheNewValue = 1
  }

Options

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

Name Value
IndentSpaceNum 2
PageWidth 120
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 40
MaxInfixOperatorExpression 50
MaxRecordWidth 40
MaxArrayOrListWidth 40
MaxLetBindingWidth 40
MultilineBlockBracketsOnSameColumn true
NewlineBetweenTypeDefinitionAndMembers false
StrictMode false
@nojaf
Copy link
Contributor

nojaf commented May 8, 2020

Not sure this is a bug actually. Is your code not compiling anymore?
The MultilineBlockBracketsOnSameColumn was introduced to comply with this rule.

And as with the record guidance, you may want to dedicate separate lines for the braces and indent one scope to the right with the expression.

One extra scope was added to before TheNewValue = 1 so that seems ok to me.
Am I missing something here?

//cc @Smaug123

@JonCanning
Copy link
Author

It compilies but I get an indentation warning, but if you disable MultilineBlockBracketsOnSameColumn it works. It's only a problem if IndentSpaceNum is 2

@nojaf
Copy link
Contributor

nojaf commented May 9, 2020

I believe the problem is resolved if you put TheNewValue one space further than ThisIsAThing.Empty.
One space would be weird so another indentation would make more sense.
I think we can add a check for this, should look into it more to be certain.

@nojaf
Copy link
Contributor

nojaf commented May 16, 2020

@JonCanning I released alpha 005 with this fix.

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 a pull request may close this issue.

2 participants