-
Notifications
You must be signed in to change notification settings - Fork 83
Don't join multi-part literals #393
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #393 +/- ##
=======================================
Coverage 99.72% 99.72%
=======================================
Files 90 90
Lines 731 736 +5
Branches 140 140
=======================================
+ Hits 729 734 +5
Misses 2 2
Continue to review full report at Codecov.
|
mattiaerre
left a comment
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.
👍
| contract MultipartStrings { | ||
| bytes b1 = hex"beef"; | ||
| bytes b2 = hex"beef"; | ||
| bytes b3 = hex"beef" hex"c0ffee"; | ||
| bytes b4 = | ||
| hex"beeeeeeeeeeeeeeeeeeeeeef" | ||
| hex"c0000000000ffeeeeeeeeeeeeeeeeeee"; | ||
|
|
||
| string s1 = "foo"; | ||
| string s2 = "foo" "bar"; | ||
| string s3 = | ||
| "foofoofoofooofoofoofofoooofofoo" | ||
| "barbarbrabrbarbarbabrabrbabr"; | ||
| } |
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.
very nice 👍
|
LGTM!!! Can't wait to clean up some contracts! |
|
Also in semi-related issues to allow for multiline hex literals output by this new formatter: |
|
@junderw they just need to update the parser to the latest version :) |
Closes #391
This PR prevents prettier from joining multi-part strings and hex literals. It also prints each one in a separate line when the line is too long.