Skip to content

Fixed recursiveDescription formatting #79

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

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct SwiftInterfaceChangeConsolidator: SwiftInterfaceChangeConsolidating {
let listOfChanges = listOfChanges(between: change, and: match)

if listOfChanges.isEmpty {
assertionFailure("We should not end up here - investigate how this happened")
print("⚠ We should not end up here - investigate how this happened")
break
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ extension SwiftInterfaceElement {
recursiveDescription.append("\n\(String(repeating: spacer, count: indentation))}")
}

if indentation == 0 {
recursiveDescription.append("\n")
}

return recursiveDescription
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/IntegrationTests/ReferencePackageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ReferencePackageTests: XCTestCase {

for i in 0..<expectedLines.count {
if expectedLines[i] != markdownOutputLines[i] {
XCTAssertEqual(expectedLines[i], markdownOutputLines[i])
XCTAssertEqual(expectedLines[i], markdownOutputLines[i], "Issue in line \(i)")
return
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,21 @@ public enum RawValueEnum: Swift.String, Swift.Equatable, Swift.Hashable, Swift.R
public typealias RawValue = Swift.String
public var rawValue: Swift.String { get }
}

```
```javascript
public protocol ParentProtocol {
associatedtype ParentType: Swift.Equatable where Self.ParentType == Self.Iterator.Element
associatedtype Iterator: Swift.Collection
}

```
```javascript
public protocol ParentProtocol<ParentType> {
associatedtype ParentType: Swift.Equatable where Self.ParentType == Self.Iterator.Element
associatedtype Iterator: Swift.Collection
}

```
```javascript
public protocol SimpleProtocol

```
#### 🔀 Modified
```javascript
Expand Down Expand Up @@ -108,33 +104,26 @@ Changes:
extension Swift.Array {
public subscript(safe index: Swift.Int) -> Element? { get }
}

```
### `CustomClass`
#### ❇️ Added
```javascript
final public let a: Swift.Int { get }

```
```javascript
final public let b: Swift.Int { get }

```
```javascript
final public let c: Swift.Int { get }

```
```javascript
final public let d: Swift.Double { get }

```
```javascript
public subscript(index: Swift.Int) -> T? { get set }

```
```javascript
public var lazyVar: Swift.String { get set }

```
#### 🔀 Modified
```javascript
Expand Down Expand Up @@ -181,40 +170,32 @@ Changes:
#### ❇️ Added
```javascript
case a

```
```javascript
case b

```
```javascript
case c

```
```javascript
case caseWithNamedString(title: T)

```
```javascript
case d

```
```javascript
case e(ReferencePackage.CustomEnum<T>.NestedStructInExtension)

```
```javascript
extension ReferencePackage.CustomEnum where T == Swift.String {
public var titleOfCaseWithNamedString: Swift.String? { get }
}

```
```javascript
public struct NestedStructInExtension {
public let string: Swift.String { get }
public init(string: Swift.String = "Hello")
}

```
#### 🔀 Modified
```javascript
Expand Down Expand Up @@ -259,19 +240,15 @@ case caseWithString(Swift.String)
#### ❇️ Added
```javascript
associatedtype AnotherAssociatedType: Swift.Strideable

```
```javascript
associatedtype AnotherAssociatedType: Swift.Strideable

```
```javascript
associatedtype CustomAssociatedType: Swift.Equatable

```
```javascript
associatedtype CustomAssociatedType: Swift.Equatable

```
#### 🔀 Modified
```javascript
Expand Down Expand Up @@ -324,23 +301,18 @@ public struct NestedStruct {
@available(swift 5.9)
public let nestedVar: Swift.String { get }
}

```
```javascript
public typealias AnotherAssociatedType = Swift.Double

```
```javascript
public typealias CustomAssociatedType = Swift.Int

```
```javascript
public typealias Iterator = [ReferencePackage.CustomStruct<T>.AnotherAssociatedType]

```
```javascript
public typealias ParentType = Swift.Double

```
#### 🔀 Modified
```javascript
Expand Down Expand Up @@ -386,17 +358,14 @@ Changes:
```javascript
@_spi(SystemProgrammingInterface)
public typealias AnotherAssociatedType = T

```
```javascript
@_spi(SystemProgrammingInterface)
public typealias Iterator = [Swift.Double]

```
```javascript
@_spi(SystemProgrammingInterface)
public typealias ParentType = Swift.Double

```
#### 🔀 Modified
```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,21 @@ public enum RawValueEnum: Swift.String, Swift.Equatable, Swift.Hashable, Swift.R
public typealias RawValue = Swift.String
public var rawValue: Swift.String { get }
}

```
```javascript
public protocol ParentProtocol {
associatedtype ParentType: Swift.Equatable where Self.ParentType == Self.Iterator.Element
associatedtype Iterator: Swift.Collection
}

```
```javascript
public protocol ParentProtocol<ParentType> {
associatedtype ParentType: Swift.Equatable where Self.ParentType == Self.Iterator.Element
associatedtype Iterator: Swift.Collection
}

```
```javascript
public protocol SimpleProtocol

```
#### 🔀 Modified
```javascript
Expand Down Expand Up @@ -93,33 +89,26 @@ Changes:
extension Swift.Array {
public subscript(safe index: Swift.Int) -> Element? { get }
}

```
### `CustomClass`
#### ❇️ Added
```javascript
final public let a: Swift.Int { get }

```
```javascript
final public let b: Swift.Int { get }

```
```javascript
final public let c: Swift.Int { get }

```
```javascript
final public let d: Swift.Double { get }

```
```javascript
public subscript(index: Swift.Int) -> T? { get set }

```
```javascript
public var lazyVar: Swift.String { get set }

```
#### 🔀 Modified
```javascript
Expand Down Expand Up @@ -166,40 +155,32 @@ Changes:
#### ❇️ Added
```javascript
case a

```
```javascript
case b

```
```javascript
case c

```
```javascript
case caseWithNamedString(title: T)

```
```javascript
case d

```
```javascript
case e(ReferencePackage.CustomEnum<T>.NestedStructInExtension)

```
```javascript
extension ReferencePackage.CustomEnum where T == Swift.String {
public var titleOfCaseWithNamedString: Swift.String? { get }
}

```
```javascript
public struct NestedStructInExtension {
public let string: Swift.String { get }
public init(string: Swift.String = "Hello")
}

```
#### 🔀 Modified
```javascript
Expand Down Expand Up @@ -244,19 +225,15 @@ case caseWithString(Swift.String)
#### ❇️ Added
```javascript
associatedtype AnotherAssociatedType: Swift.Strideable

```
```javascript
associatedtype AnotherAssociatedType: Swift.Strideable

```
```javascript
associatedtype CustomAssociatedType: Swift.Equatable

```
```javascript
associatedtype CustomAssociatedType: Swift.Equatable

```
#### 🔀 Modified
```javascript
Expand Down Expand Up @@ -309,23 +286,18 @@ public struct NestedStruct {
@available(swift 5.9)
public let nestedVar: Swift.String { get }
}

```
```javascript
public typealias AnotherAssociatedType = Swift.Double

```
```javascript
public typealias CustomAssociatedType = Swift.Int

```
```javascript
public typealias Iterator = [ReferencePackage.CustomStruct<T>.AnotherAssociatedType]

```
```javascript
public typealias ParentType = Swift.Double

```
#### 🔀 Modified
```javascript
Expand Down
Loading