-
Notifications
You must be signed in to change notification settings - Fork 73
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
Avoid having small right operand on its own line #180
Conversation
Codecov Report
@@ Coverage Diff @@
## master #180 +/- ##
==========================================
- Coverage 99% 98.68% -0.32%
==========================================
Files 74 74
Lines 601 609 +8
Branches 96 100 +4
==========================================
+ Hits 595 601 +6
- Misses 6 8 +2
Continue to review full report at Codecov.
|
prettier js formats the following: veryVeryVeryVeryVeryLongVariableCalledA - veryVeryVeryVeryVeryLongVariableCalledB - 1 -1 -1 - 1 - 1 - 1 - 1; like, veryVeryVeryVeryVeryLongVariableCalledA -
veryVeryVeryVeryVeryLongVariableCalledB -
1 -
1 -
1 -
1 -
1 -
1 -
1; have a look at #175 to see other ways prettier js groups ecuations that we are reviewing right now for solidity. |
My mistake, however it formats a(veryVeryVeryVeryVeryLongVariableCalledA + veryVeryVeryVeryVeryLongVariableCalledB) - 1; like a(
veryVeryVeryVeryVeryLongVariableCalledA +
veryVeryVeryVeryVeryLongVariableCalledB
) - 1; Would you consider something like the revised version of this pull request, which handles both veryVeryVeryVeryVeryLongVariableCalledA -
veryVeryVeryVeryVeryLongVariableCalledB -
1 -
1 -
1 -
1 -
1 -
1 -
1; and a(
veryVeryVeryVeryVeryLongVariableCalledA +
veryVeryVeryVeryVeryLongVariableCalledB
) - 1; ? |
hahaha this one is a weird one. s = a(veryVeryVeryVeryVeryLongVariableCalledA + veryVeryVeryVeryVeryLongVariableCalledB) - 1;
2 - a(veryVeryVeryVeryVeryLongVariableCalledA + veryVeryVeryVeryVeryLongVariableCalledB) - 1;
a(veryVeryVeryVeryVeryLongVariableCalledA + veryVeryVeryVeryVeryLongVariableCalledB) - 1 + 2; I get s =
a(
veryVeryVeryVeryVeryLongVariableCalledA +
veryVeryVeryVeryVeryLongVariableCalledB
) - 1;
2 -
a(
veryVeryVeryVeryVeryLongVariableCalledA +
veryVeryVeryVeryVeryLongVariableCalledB
) -
1;
a(
veryVeryVeryVeryVeryLongVariableCalledA +
veryVeryVeryVeryVeryLongVariableCalledB
) -
1 +
2; I like having this particular edge case as long as the main rule is not broken, could you add test cases?? |
const right = concat([node.operator, line, path.call(print, 'right')]); | ||
const parent = path.getParentNode(); | ||
const shouldGroup = | ||
parent.type !== node.type && node.left.type !== node.type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also document why this particular type mismatch deserves a grouping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Will do!
355fdc4
to
818f52e
Compare
I've rebased on #182: I added tests for
|
a303e72
to
7130b5a
Compare
how can we fix this cov report issue? I'll try to reach out to the Codecov team and see what they say |
13abec2
to
1a62513
Compare
can you resolve the conflicts here too @jablko ? thanks |
@mattiaerre Absolutely: Rebased. |
thanks so much @jablko |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
over to you @jablko
@@ -330,8 +326,7 @@ contract ArithmeticOperators { | |||
veryVeryVeryVeryVeryLongVariableCalledB; | |||
veryVeryVeryVeryVeryLongFunctionCalledA( | |||
veryVeryVeryVeryVeryLongVariableCalledB | |||
) ** | |||
c; | |||
)**c; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noticing that there is no space before **
and after it; is that what we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was applied in #174
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we approve this PR?
Would you consider grouping the right operand, like language-js, "to avoid having a small right part like -1 be on its own line"?