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

Brackets increased every time Fantomas is run #989

Closed
1 of 3 tasks
reinux opened this issue Jul 26, 2020 · 1 comment · Fixed by #991
Closed
1 of 3 tasks

Brackets increased every time Fantomas is run #989

reinux opened this issue Jul 26, 2020 · 1 comment · Fixed by #991

Comments

@reinux
Copy link

reinux commented Jul 26, 2020

Issue created from fantomas-online

Code

(something_really_long
  + another_thing_thats_really_long).A

Result

((something_really_long
  + another_thing_thats_really_long)).A

Code

((something_really_long
  + another_thing_thats_really_long)).A

Result

(((something_really_long
  + another_thing_thats_really_long))).A

Problem description

This is the simplest reproduction I could find.

It seems to happen when the bracket is split over multiple lines, and when there's an operator in between two terms, and when a member reference is made on the bracketed expression.

Running Fantomas again over the output causes the brackets to continue growing.

Extra information

  • The formatted result breaks by code. (kind of)
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas Master at 07/20/2020 08:56:02 - d42a156

Name Value
IndentSize 4
MaxLineLength 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
MaxValueBindingWidth 40
MaxFunctionBindingWidth 40
MultilineBlockBracketsOnSameColumn false
NewlineBetweenTypeDefinitionAndMembers false
KeepIfThenInSameLine false
MaxElmishWidth 40
SingleArgumentWebMode false
AlignFunctionSignatureToIndentation false
AlternativeLongMemberDefinitions false
StrictMode false
nojaf added a commit to nojaf/fantomas that referenced this issue Aug 7, 2020
nojaf added a commit that referenced this issue Aug 10, 2020
* Don't add extra parenthesis for DotGet(Paren(_)), fixes #989

* Added regression test for #921.
@reinux
Copy link
Author

reinux commented Aug 10, 2020

Thanks! Appreciated

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.

1 participant