Skip to content

Commit ff4ba14

Browse files
authored
Resolve a few recently introduced warnings (#1103)
* Resolve warning about use of deprecated render node `hierarchy` property * Resolve warning about use of deprecated bundle `identifier` property * Remove need to `@testable import` in test utilities target
1 parent 75344ae commit ff4ba14

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

Sources/SwiftDocC/Infrastructure/DocumentationContext.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public class DocumentationContext {
144144
case .legacy(let legacyDataProvider):
145145
return try legacyDataProvider.contentsOfURL(url, in: bundle)
146146
case .new(let dataProvider):
147-
assert(self.bundle?.identifier == bundle.identifier, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
147+
assert(self.bundle?.id == bundle.id, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
148148
return try dataProvider.contents(of: url)
149149
}
150150
}
@@ -392,7 +392,7 @@ public class DocumentationContext {
392392
case .legacy(let legacyDataProvider):
393393
return legacyDataProvider.bundles[identifier]
394394
case .new:
395-
assert(bundle?.identifier == identifier, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
395+
assert(bundle?.id.rawValue == identifier, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
396396
return bundle?.id.rawValue == identifier ? bundle : nil
397397
}
398398
}

Sources/SwiftDocC/Utility/FoundationExtensions/String+Path.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
This source file is part of the Swift.org open source project
33

4-
Copyright (c) 2021 Apple Inc. and the Swift project authors
4+
Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
55
Licensed under Apache License v2.0 with Runtime Library Exception
66

77
See https://swift.org/LICENSE.txt for license information
@@ -18,13 +18,13 @@ extension StringProtocol {
1818
}
1919

2020
/// A copy of the string appended with a slash ("/") if the string doesn't already end with a trailing slash.
21-
var appendingTrailingSlash: String {
21+
package var appendingTrailingSlash: String {
2222
guard !hasSuffix("/") else { return String(self) }
2323
return self.appending("/")
2424
}
2525

2626
/// A copy of the string without a leading slash ("/") or the original string if it doesn't start with a leading slash.
27-
var removingLeadingSlash: String {
27+
package var removingLeadingSlash: String {
2828
guard hasPrefix("/") else { return String(self) }
2929
return String(dropFirst())
3030
}

Sources/SwiftDocCTestUtilities/TestFileSystem.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import Foundation
1212
import XCTest
13-
@testable import SwiftDocC
13+
import SwiftDocC
1414

1515
/// A Data provider and file manager that accepts pre-built documentation bundles with files on the local filesystem.
1616
///
@@ -321,7 +321,7 @@ package class TestFileSystem: FileManagerProtocol {
321321
case invalidPath(String)
322322
var errorDescription: String {
323323
switch self {
324-
case .invalidPath(let path): return "Invalid path \(path.singleQuoted)"
324+
case .invalidPath(let path): return "Invalid path '\(path)'"
325325
}
326326
}
327327
}

Sources/SwiftDocCUtilities/Action/Actions/Merge/MergeAction+SynthesizedLandingPage.swift

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ extension MergeAction {
6767
renderNode.metadata.title = name
6868
renderNode.metadata.roleHeading = roleHeading
6969
renderNode.metadata.role = "collection"
70-
renderNode.hierarchy = nil
7170
renderNode.sections = []
7271

7372
if rootRenderReferences.containsBothKinds {

0 commit comments

Comments
 (0)