Skip to content

Commit 2a7c711

Browse files
stephencelisgithub-actions[bot]
authored andcommitted
Run swift-format
1 parent f01efb2 commit 2a7c711

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

Sources/CustomDump/Diff.swift

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -123,24 +123,26 @@ public func diff<T>(_ lhs: T, _ rhs: T, format: DiffFormat = .default) -> String
123123
!(lhs is _CustomDiffObject),
124124
!(rhs is _CustomDiffObject)
125125
{
126-
let lhsDump = _customDump(
127-
lhs,
128-
name: lhsName,
129-
nameSuffix: nameSuffix,
130-
indent: indent,
131-
isRoot: false,
132-
maxDepth: 0,
133-
tracker: &tracker
134-
) + separator
135-
let rhsDump = _customDump(
136-
rhs,
137-
name: rhsName,
138-
nameSuffix: nameSuffix,
139-
indent: indent,
140-
isRoot: false,
141-
maxDepth: 0,
142-
tracker: &tracker
143-
) + separator
126+
let lhsDump =
127+
_customDump(
128+
lhs,
129+
name: lhsName,
130+
nameSuffix: nameSuffix,
131+
indent: indent,
132+
isRoot: false,
133+
maxDepth: 0,
134+
tracker: &tracker
135+
) + separator
136+
let rhsDump =
137+
_customDump(
138+
rhs,
139+
name: rhsName,
140+
nameSuffix: nameSuffix,
141+
indent: indent,
142+
isRoot: false,
143+
maxDepth: 0,
144+
tracker: &tracker
145+
) + separator
144146
if lhsDump == rhsDump {
145147
print(
146148
"// Not equal but no difference detected:"
@@ -525,8 +527,7 @@ public func diff<T>(_ lhs: T, _ rhs: T, format: DiffFormat = .default) -> String
525527
areInIncreasingOrder: lhsMirror.subjectType is _UnorderedCollection.Type
526528
? {
527529
let (lhsValue, rhsValue): (Any, Any)
528-
if
529-
let lhs = $0.value as? (key: AnyHashable, value: Any),
530+
if let lhs = $0.value as? (key: AnyHashable, value: Any),
530531
let rhs = $1.value as? (key: AnyHashable, value: Any)
531532
{
532533
lhsValue = lhs.key.base

Tests/CustomDumpTests/DiffTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ final class DiffTests: XCTestCase {
113113
let u2 = User(id: 2, name: "Blob Jr.")
114114
let u3 = User(id: 3, name: "Blob Sr.")
115115

116-
struct Three { let u1: User, u2: User, u3: User}
116+
struct Three { let u1: User, u2: User, u3: User }
117117

118118
XCTAssertNoDifference(
119119
diff(

Tests/CustomDumpTests/DumpTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ final class DumpTests: XCTestCase {
710710
func testKeyPath() {
711711
// NB: While this should run on >=5.9, it currently crashes CI on Xcode 15.2
712712
#if swift(>=5.10) && (os(iOS) || os(macOS) || os(tvOS) || os(watchOS))
713-
var dump = ""
713+
var dump = ""
714714
if #available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *) {
715715
dump = ""
716716
customDump(\UserClass.name, to: &dump)
@@ -1390,7 +1390,7 @@ final class DumpTests: XCTestCase {
13901390
let objs1 = DiffableObjects(obj1: obj1, obj2: obj1)
13911391
let objs2 = DiffableObjects(obj1: obj2, obj2: obj2)
13921392
let objsParent = DiffableObjectsParent(objs1: objs1, objs2: objs2)
1393-
1393+
13941394
XCTAssertNoDifference(
13951395
String(customDumping: objsParent),
13961396
"""

0 commit comments

Comments
 (0)