Skip to content

Commit d9f40b2

Browse files
committed
excluding some @_ attributes
1 parent 15d9a44 commit d9f40b2

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

Sources/PublicModules/PADProjectBuilder/SwiftInterfaceProducer/SwiftInterfaceProducer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ extension SwiftInterfaceProducer {
119119
newProjectDirectoryPath: String,
120120
oldProjectDirectoryPath: String,
121121
scheme: String
122-
) async throws -> DerivedDataPaths { // TODO: Typed return type
122+
) async throws -> DerivedDataPaths {
123123

124124
// We don't run them in parallel to not conflict with resolving dependencies concurrently
125125

Sources/PublicModules/PADSwiftInterfaceDiff/SwiftInterfaceParser/DeclSyntax+SwiftInterface/DeclSyntax+Convenience.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@ extension SyntaxCollection {
88
}
99
}
1010

11+
extension AttributeListSyntax {
12+
13+
private var excludedAttributes: Set<String> {
14+
[
15+
"@_hasMissingDesignatedInitializers",
16+
"@_inheritsConvenienceInitializers"
17+
]
18+
}
19+
20+
/// Produces a description where all elements in the list are mapped to their `trimmedDescription`
21+
var sanitizedList: [String] {
22+
self.compactMap {
23+
let description = $0.trimmedDescription
24+
if excludedAttributes.contains(description) { return nil }
25+
return description
26+
}
27+
}
28+
}
29+
1130
extension InheritedTypeListSyntax {
1231

1332
/// Produces a description where all elements in the list are mapped to their type's `trimmedDescription`

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public protocol SimpleProtocol
3838
#### 🔀 Changed
3939
```javascript
4040
// From
41-
@_hasMissingDesignatedInitializers public actor CustomActor
41+
public actor CustomActor
4242

4343
// To
44-
@_hasMissingDesignatedInitializers public actor CustomActor: ReferencePackage.SimpleProtocol
44+
public actor CustomActor: ReferencePackage.SimpleProtocol
4545

4646
/**
4747
Changes:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public protocol SimpleProtocol
3838
#### 🔀 Changed
3939
```javascript
4040
// From
41-
@_hasMissingDesignatedInitializers public actor CustomActor
41+
public actor CustomActor
4242

4343
// To
44-
@_hasMissingDesignatedInitializers public actor CustomActor: ReferencePackage.SimpleProtocol
44+
public actor CustomActor: ReferencePackage.SimpleProtocol
4545

4646
/**
4747
Changes:

0 commit comments

Comments
 (0)