Skip to content

Commit

Permalink
Resolve a few recently introduced warnings (#1103)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
d-ronnqvist authored Dec 2, 2024
1 parent 75344ae commit ff4ba14
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Sources/SwiftDocC/Infrastructure/DocumentationContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public class DocumentationContext {
case .legacy(let legacyDataProvider):
return try legacyDataProvider.contentsOfURL(url, in: bundle)
case .new(let dataProvider):
assert(self.bundle?.identifier == bundle.identifier, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
assert(self.bundle?.id == bundle.id, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
return try dataProvider.contents(of: url)
}
}
Expand Down Expand Up @@ -392,7 +392,7 @@ public class DocumentationContext {
case .legacy(let legacyDataProvider):
return legacyDataProvider.bundles[identifier]
case .new:
assert(bundle?.identifier == identifier, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
assert(bundle?.id.rawValue == identifier, "New code shouldn't pass unknown bundle identifiers to 'DocumentationContext.bundle(identifier:)'.")
return bundle?.id.rawValue == identifier ? bundle : nil
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

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

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

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

/// A copy of the string without a leading slash ("/") or the original string if it doesn't start with a leading slash.
var removingLeadingSlash: String {
package var removingLeadingSlash: String {
guard hasPrefix("/") else { return String(self) }
return String(dropFirst())
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftDocCTestUtilities/TestFileSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import Foundation
import XCTest
@testable import SwiftDocC
import SwiftDocC

/// A Data provider and file manager that accepts pre-built documentation bundles with files on the local filesystem.
///
Expand Down Expand Up @@ -321,7 +321,7 @@ package class TestFileSystem: FileManagerProtocol {
case invalidPath(String)
var errorDescription: String {
switch self {
case .invalidPath(let path): return "Invalid path \(path.singleQuoted)"
case .invalidPath(let path): return "Invalid path '\(path)'"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ extension MergeAction {
renderNode.metadata.title = name
renderNode.metadata.roleHeading = roleHeading
renderNode.metadata.role = "collection"
renderNode.hierarchy = nil
renderNode.sections = []

if rootRenderReferences.containsBothKinds {
Expand Down

0 comments on commit ff4ba14

Please sign in to comment.