-
Notifications
You must be signed in to change notification settings - Fork 21
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
implement new line for brace #92
Conversation
582fad3
to
fe4f34d
Compare
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.
Congrats for fist commit 🎉
Dog( | ||
id: "pochi", | ||
name: "ポチ", | ||
nickname: nil, | ||
age: 3, | ||
homepage: https://www.google.com/ | ||
) |
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.
I think about indent-size are should decided by Debug.Option.indent
instead of class (or struct) name.
// indent = 2
Dog(
id: "pochi",
name: "ポチ",
...
// indent = 4
Dog(
id: "pochi",
name: "ポチ",
...
What do you think?
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.
Fixed like that the indent depends on Debug.Option.
@@ -66,18 +66,19 @@ class MultilineFormatter: PrettyFormatter { | |||
func objectString( |
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.
I though about this format are decided by new option item Option.debug. objectFormat
in detail design of #49 😅
But it's not bad idea that support only this style...
Which is better for the user...?
What do you think?
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.
I think option.objectFormat
is not needed.
"dog-1": Dog( | ||
id: "pochi", | ||
name: "ポチ", | ||
nickname: nil, | ||
age: 3, | ||
homepage: https://www.google.com/ | ||
), |
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.
Hmmm, should we change dictionary format too for consistency of format? (I didn't think about this)
"dog-1": Dog(
id: "pochi",
name: "ポチ",
nickname: nil,
age: 3,
homepage: https://www.google.com/,
// dictionary in dictionary
dict: [
"apple": Apple(
price: 100,
sale: true
) ,
"orange": Orange(
price: 100,
sale: true
)
]
),
What do you think?
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.
It's depends on MultilineFormatter.objectString
.
I think this consistency is not bad.
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.
Are you say in other words that this problem should fixed but not in this PR?
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.
oh, it will be fixed this issue.
#95
Codecov Report
@@ Coverage Diff @@
## master #92 +/- ##
==========================================
+ Coverage 77.25% 77.39% +0.14%
==========================================
Files 9 9
Lines 321 323 +2
==========================================
+ Hits 248 250 +2
Misses 73 73
Continue to review full report at Codecov.
|
Co-Authored-By: Yusuke Hosonuma <tobi462@gmail.com>
…eHosonuma/SwiftPrettyPrint into feature/new-line-break-style
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.
Good work!
Please confirm last one comment from me.
) | ||
) | ||
""" | ||
|
||
formatter = MultilineFormatter(option: option(indent: 2)) |
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.
Please add test when indent size are 4
too :)
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.
added test!
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.
Great!!
Thanks for reviewing!!!! |
resolved #49
As is
At first glance, it is difficult to understand the hierarchy
If the following is implimented,
the result will be the following.
To be
Using indent and new-line make the hierarchy easier to understand.
the result will be the following.