Skip to content

Commit eabb166

Browse files
committed
More descriptive removals
1 parent 409b408 commit eabb166

File tree

4 files changed

+60
-29
lines changed

4 files changed

+60
-29
lines changed

ReferencePackages/ReferencePackage/Sources/ReferencePackage/ReferencePackage.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,20 @@ public enum CustomEnum {
140140

141141
indirect case recursive(CustomEnum)
142142
}
143+
144+
public struct PublicStructThatIsOnlyAvailableInTheReferencePackage {
145+
146+
public var foo: String
147+
public func bar() -> Void {
148+
print("Hello")
149+
}
150+
}
151+
152+
public extension CustomEnum {
153+
enum PublicEnumInExtensionOfCustomEnumThatIsOnlyAvailableInTheReferencePackage {
154+
case alpha
155+
case beta
156+
}
157+
}
158+
159+
public extension CustomEnum {}

Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceAnalyzer/SwiftInterfaceAnalyzer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct SwiftInterfaceAnalyzer: SwiftInterfaceAnalyzing {
8181

8282
// No matching element was found so either it was removed or added
8383
let changeType: IndependentSwiftInterfaceChange.ChangeType = oldFirst ?
84-
.removal(lhsElement.description) :
84+
.removal(lhsElement.recursiveDescription()) :
8585
.addition(lhsElement.recursiveDescription())
8686

8787
return [

Tests/IntegrationTests/Resources/expected-reference-changes-swift-interface-private.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ⚠️ 58 public changes detected ⚠️
1+
# ⚠️ 57 public changes detected ⚠️
22
_Comparing `new_private` to `old_private`_
3-
<table><tr><td>❇️</td><td><b>34 Additions</b></td></tr><tr><td>🔀</td><td><b>22 Modifications</b></td></tr><tr><td>❌</td><td><b>2 Removals</b></td></tr></table>
3+
<table><tr><td>❇️</td><td><b>31 Additions</b></td></tr><tr><td>🔀</td><td><b>22 Modifications</b></td></tr><tr><td>❌</td><td><b>4 Removals</b></td></tr></table>
44

55
---
66
## `ReferencePackage`
@@ -33,12 +33,6 @@ public enum RawValueEnum: Swift.Equatable, Swift.Hashable, Swift.RawRepresentabl
3333
}
3434
```
3535
```javascript
36-
public protocol ParentProtocol {
37-
associatedtype Iterator: Swift.Collection
38-
associatedtype ParentType: Swift.Equatable where Self.ParentType == Self.Iterator.Element
39-
}
40-
```
41-
```javascript
4236
public protocol ParentProtocol<ParentType> {
4337
associatedtype Iterator: Swift.Collection
4438
associatedtype ParentType: Swift.Equatable where Self.ParentType == Self.Iterator.Element
@@ -121,6 +115,13 @@ Changes:
121115
- Added generic where clause `where T : Swift.Strideable`
122116
*/
123117
```
118+
#### ❌ Removed
119+
```javascript
120+
public struct PublicStructThatIsOnlyAvailableInTheReferencePackage {
121+
public func bar() -> Swift.Void
122+
public var foo: Swift.String
123+
}
124+
```
124125
### `Array`
125126
#### ❇️ Added
126127
```javascript
@@ -278,20 +279,26 @@ Changes:
278279
```javascript
279280
case caseWithString(Swift.String)
280281
```
281-
### `CustomProtocol`
282-
#### ❇️ Added
283282
```javascript
284-
associatedtype AnotherAssociatedType: Swift.Strideable
283+
public enum PublicEnumInExtensionOfCustomEnumThatIsOnlyAvailableInTheReferencePackage: Swift.Equatable, Swift.Hashable {
284+
case alpha
285+
case beta
286+
public func hash(into hasher: inout Swift.Hasher) -> Swift.Void
287+
public static func ==(
288+
a: ReferencePackage.CustomEnum.PublicEnumInExtensionOfCustomEnumThatIsOnlyAvailableInTheReferencePackage,
289+
b: ReferencePackage.CustomEnum.PublicEnumInExtensionOfCustomEnumThatIsOnlyAvailableInTheReferencePackage
290+
) -> Swift.Bool
291+
public var hashValue: Swift.Int { get }
292+
}
285293
```
294+
### `CustomProtocol`
295+
#### ❇️ Added
286296
```javascript
287297
associatedtype AnotherAssociatedType: Swift.Strideable
288298
```
289299
```javascript
290300
associatedtype CustomAssociatedType: Swift.Equatable
291301
```
292-
```javascript
293-
associatedtype CustomAssociatedType: Swift.Equatable
294-
```
295302
#### 🔀 Modified
296303
```javascript
297304
// From

Tests/IntegrationTests/Resources/expected-reference-changes-swift-interface-public.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ⚠️ 49 public changes detected ⚠️
1+
# ⚠️ 48 public changes detected ⚠️
22
_Comparing `new_public` to `old_public`_
3-
<table><tr><td>❇️</td><td><b>31 Additions</b></td></tr><tr><td>🔀</td><td><b>16 Modifications</b></td></tr><tr><td>❌</td><td><b>2 Removals</b></td></tr></table>
3+
<table><tr><td>❇️</td><td><b>28 Additions</b></td></tr><tr><td>🔀</td><td><b>16 Modifications</b></td></tr><tr><td>❌</td><td><b>4 Removals</b></td></tr></table>
44

55
---
66
## `ReferencePackage`
@@ -33,12 +33,6 @@ public enum RawValueEnum: Swift.Equatable, Swift.Hashable, Swift.RawRepresentabl
3333
}
3434
```
3535
```javascript
36-
public protocol ParentProtocol {
37-
associatedtype Iterator: Swift.Collection
38-
associatedtype ParentType: Swift.Equatable where Self.ParentType == Self.Iterator.Element
39-
}
40-
```
41-
```javascript
4236
public protocol ParentProtocol<ParentType> {
4337
associatedtype Iterator: Swift.Collection
4438
associatedtype ParentType: Swift.Equatable where Self.ParentType == Self.Iterator.Element
@@ -106,6 +100,13 @@ Changes:
106100
- Added generic where clause `where T : Swift.Strideable`
107101
*/
108102
```
103+
#### ❌ Removed
104+
```javascript
105+
public struct PublicStructThatIsOnlyAvailableInTheReferencePackage {
106+
public func bar() -> Swift.Void
107+
public var foo: Swift.String
108+
}
109+
```
109110
### `Array`
110111
#### ❇️ Added
111112
```javascript
@@ -263,20 +264,26 @@ Changes:
263264
```javascript
264265
case caseWithString(Swift.String)
265266
```
266-
### `CustomProtocol`
267-
#### ❇️ Added
268267
```javascript
269-
associatedtype AnotherAssociatedType: Swift.Strideable
268+
public enum PublicEnumInExtensionOfCustomEnumThatIsOnlyAvailableInTheReferencePackage: Swift.Equatable, Swift.Hashable {
269+
case alpha
270+
case beta
271+
public func hash(into hasher: inout Swift.Hasher) -> Swift.Void
272+
public static func ==(
273+
a: ReferencePackage.CustomEnum.PublicEnumInExtensionOfCustomEnumThatIsOnlyAvailableInTheReferencePackage,
274+
b: ReferencePackage.CustomEnum.PublicEnumInExtensionOfCustomEnumThatIsOnlyAvailableInTheReferencePackage
275+
) -> Swift.Bool
276+
public var hashValue: Swift.Int { get }
277+
}
270278
```
279+
### `CustomProtocol`
280+
#### ❇️ Added
271281
```javascript
272282
associatedtype AnotherAssociatedType: Swift.Strideable
273283
```
274284
```javascript
275285
associatedtype CustomAssociatedType: Swift.Equatable
276286
```
277-
```javascript
278-
associatedtype CustomAssociatedType: Swift.Equatable
279-
```
280287
#### 🔀 Modified
281288
```javascript
282289
// From

0 commit comments

Comments
 (0)