-
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
fix: indent consistency of multiline-format #96
Conversation
…tion`, and rename `indent` to `indentSize`
Codecov Report
@@ Coverage Diff @@
## master #96 +/- ##
==========================================
+ Coverage 77.39% 77.60% +0.20%
==========================================
Files 9 9
Lines 323 326 +3
==========================================
+ Hits 250 253 +3
Misses 73 73
Continue to review full report at Codecov.
|
@@ -6,44 +6,50 @@ | |||
// | |||
|
|||
class MultilineFormatter: PrettyFormatter { | |||
private let option: Debug.Option | |||
private let indentSize: Int |
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.
Refactor: MultilineFormatter
depends on indentSize
instead of Debug.Option
.
|
||
init(option: Debug.Option) { | ||
self.option = option | ||
init(indentSize: Int) { |
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.
Refactor: rename to indentSize
from indent
because the name indent
is ambiguous.
} | ||
|
||
func collectionString(elements: [String]) -> String { | ||
""" | ||
let contents = elements.joined(separator: ",\n") |
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.
Refactor: for consistency of code-style.
return formatter.dictionaryString(keysAndValues: keysAndValues) | ||
} | ||
|
||
assert(to: f, with: assertEqualLines) { |
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.
Introduce parameterized-test. But not so easy to read? 😅
e833df9
to
dea6a34
Compare
// [ | ||
// "one": Dog(id: "pochi", | ||
// price: 10.0, | ||
// name: "ポチ"), | ||
// "two": Dog(id: "pochi", | ||
// price: 10.0, | ||
// name: "ポチ") | ||
// "one": Dog( | ||
// id: "pochi", | ||
// price: 10.0, | ||
// name: "ポチ" | ||
// ), | ||
// "two": Dog( | ||
// id: "pochi", | ||
// price: 10.0, | ||
// name: "ポチ" | ||
// ) | ||
// ] |
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 got perfectly expected behavior in Example app :)
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.
lgtm!
resolved #95
TODO