Skip to content

Commit 2bd30b1

Browse files
authored
Revert "Resolve all current code warnings (#1143)" (#1145)
This reverts commit b1d4c6c.
1 parent a6855ca commit 2bd30b1

File tree

9 files changed

+23
-26
lines changed

9 files changed

+23
-26
lines changed

Package.resolved

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,17 @@
9595
"kind" : "remoteSourceControl",
9696
"location" : "https://github.com/apple/swift-nio.git",
9797
"state" : {
98-
"revision" : "ba72f31e11275fc5bf060c966cf6c1f36842a291",
99-
"version" : "2.79.0"
98+
"revision" : "fc79798d5a150d61361a27ce0c51169b889e23de",
99+
"version" : "2.68.0"
100100
}
101101
},
102102
{
103103
"identity" : "swift-system",
104104
"kind" : "remoteSourceControl",
105105
"location" : "https://github.com/apple/swift-system.git",
106106
"state" : {
107-
"revision" : "c8a44d836fe7913603e246acab7c528c2e780168",
108-
"version" : "1.4.0"
107+
"revision" : "6a9e38e7bd22a3b8ba80bddf395623cf68f57807",
108+
"version" : "1.3.1"
109109
}
110110
}
111111
],

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ let package = Package(
129129
if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
130130
// Building standalone, so fetch all dependencies remotely.
131131
package.dependencies += [
132-
.package(url: "https://github.com/apple/swift-nio.git", from: "2.78.0"),
132+
.package(url: "https://github.com/apple/swift-nio.git", from: "2.53.0"),
133133
.package(url: "https://github.com/apple/swift-markdown.git", branch: "main"),
134134
.package(url: "https://github.com/apple/swift-lmdb.git", branch: "main"),
135135
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.2"),

Sources/SwiftDocC/Indexing/Navigator/NavigatorIndex.swift

+3-7
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,7 @@ extension NavigatorIndex {
479479

480480
/// The data provider.
481481
@available(*, deprecated, message: "This deprecated API will be removed after 6.2 is released")
482-
public var renderNodeProvider: RenderNodeProvider? {
483-
_renderNodeProvider as! RenderNodeProvider?
484-
}
485-
// This property only exist to be able to assign `nil` to `renderNodeProvider` in the new initializer without causing a deprecation warning.
486-
private let _renderNodeProvider: Any?
482+
public let renderNodeProvider: RenderNodeProvider?
487483

488484
/// The documentation archive to build an index from.
489485
public let archiveURL: URL?
@@ -579,7 +575,7 @@ extension NavigatorIndex {
579575
/// - usePageTitle: Configure the builder to use the "page title" instead of the "navigator title" as the title for each entry.
580576
public init(archiveURL: URL? = nil, outputURL: URL, bundleIdentifier: String, sortRootChildrenByName: Bool = false, groupByLanguage: Bool = false, writePathsOnDisk: Bool = true, usePageTitle: Bool = false) {
581577
self.archiveURL = archiveURL
582-
self._renderNodeProvider = nil
578+
self.renderNodeProvider = nil
583579
self.outputURL = outputURL
584580
self.bundleIdentifier = bundleIdentifier
585581
self.sortRootChildrenByName = sortRootChildrenByName
@@ -591,7 +587,7 @@ extension NavigatorIndex {
591587
@available(*, deprecated, renamed: "init(archiveURL:outputURL:bundleIdentifier:sortRootChildrenByName:groupByLanguage:writePathsOnDisk:usePageTitle:)", message: "Use 'init(archiveURL:outputURL:bundleIdentifier:sortRootChildrenByName:groupByLanguage:writePathsOnDisk:usePageTitle:)' instead. This deprecated API will be removed after 6.2 is released")
592588
@_disfavoredOverload
593589
public init(renderNodeProvider: RenderNodeProvider? = nil, outputURL: URL, bundleIdentifier: String, sortRootChildrenByName: Bool = false, groupByLanguage: Bool = false, writePathsOnDisk: Bool = true, usePageTitle: Bool = false) {
594-
self._renderNodeProvider = renderNodeProvider
590+
self.renderNodeProvider = renderNodeProvider
595591
self.archiveURL = nil
596592
self.outputURL = outputURL
597593
self.bundleIdentifier = bundleIdentifier

Sources/SwiftDocC/Indexing/Navigator/NavigatorTree.swift

-5
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,7 @@ public class NavigatorTree {
119119

120120
func __read() {
121121
let deadline = DispatchTime.now() + timeout
122-
#if swift(>=5.10)
123-
// Access to this local variable is synchronized using the DispatchQueue `queue`, passed as an argument.
124-
nonisolated(unsafe) var processedNodes = [NavigatorTree.Node]()
125-
#else
126122
var processedNodes = [NavigatorTree.Node]()
127-
#endif
128123

129124
while readingCursor.cursor < readingCursor.data.count {
130125
let length = MemoryLayout<UInt32>.stride

Sources/SwiftDocCTestUtilities/XCTestCase+TemporaryDirectory.swift

+9-7
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ public extension XCTestCase {
3636
///
3737
/// - Parameters:
3838
/// - pathComponents: The name of the temporary directory.
39+
/// - fileManager: The file manager that will create the directory.
3940
/// - Returns: The URL of the newly created directory.
40-
func createTemporaryDirectory(named: String) throws -> URL {
41+
func createTemporaryDirectory(named: String, fileManager: FileManager = .default) throws -> URL {
4142
try createTemporaryDirectory(pathComponents: named)
4243
}
4344

@@ -47,8 +48,9 @@ public extension XCTestCase {
4748
///
4849
/// - Parameters:
4950
/// - pathComponents: Additional path components to add to the temporary URL.
51+
/// - fileManager: The file manager that will create the directory.
5052
/// - Returns: The URL of the newly created directory.
51-
func createTemporaryDirectory(pathComponents: String...) throws -> URL {
53+
func createTemporaryDirectory(pathComponents: String..., fileManager: FileManager = .default) throws -> URL {
5254
let bundleParentDir = Bundle(for: Self.self).bundleURL.deletingLastPathComponent()
5355
let baseURL = bundleParentDir.appendingPathComponent(name.replacingWhitespaceAndPunctuation(with: "-"))
5456

@@ -60,20 +62,20 @@ public extension XCTestCase {
6062

6163
addTeardownBlock {
6264
do {
63-
if FileManager.default.fileExists(atPath: baseURL.path) {
64-
try FileManager.default.removeItem(at: baseURL)
65+
if fileManager.fileExists(atPath: baseURL.path) {
66+
try fileManager.removeItem(at: baseURL)
6567
}
6668
} catch {
6769
XCTFail("Failed to remove temporary directory: '\(error)'")
6870
}
6971
}
7072

71-
if !FileManager.default.fileExists(atPath: bundleParentDir.path) {
73+
if !fileManager.fileExists(atPath: bundleParentDir.path) {
7274
// Create the base URL directory without intermediate directories so that an error is raised if the parent directory doesn't exist.
73-
try FileManager.default.createDirectory(at: baseURL, withIntermediateDirectories: false, attributes: nil)
75+
try fileManager.createDirectory(at: baseURL, withIntermediateDirectories: false, attributes: nil)
7476
}
7577

76-
try FileManager.default.createDirectory(at: tempURL, withIntermediateDirectories: true, attributes: nil)
78+
try fileManager.createDirectory(at: tempURL, withIntermediateDirectories: true, attributes: nil)
7779

7880
return tempURL
7981
}

Sources/SwiftDocCUtilities/PreviewServer/PreviewHTTPHandler.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ final class PreviewHTTPHandler: ChannelInboundHandler {
111111

112112
// If we don't need to keep the connection alive, close `context` after flushing the response
113113
if !self.keepAlive {
114-
promise.futureResult.assumeIsolated().whenComplete { _ in context.close(promise: nil) }
114+
promise.futureResult.whenComplete { _ in context.close(promise: nil) }
115115
}
116116

117117
context.writeAndFlush(self.wrapOutboundOut(.end(trailers)), promise: promise)

Tests/SwiftDocCUtilitiesTests/PreviewServer/PreviewHTTPHandlerTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ class PreviewHTTPHandlerTests: XCTestCase {
3333

3434
let response = Response()
3535

36+
XCTAssertNoThrow(try channel.pipeline.addHandler(HTTPResponseEncoder()).wait())
3637
XCTAssertNoThrow(try channel.pipeline.addHandler(response).wait())
3738
XCTAssertNoThrow(try channel.pipeline.addHandler(channelHandler).wait())
39+
XCTAssertNoThrow(try channel.pipeline.addHandler(HTTPServerPipelineHandler()).wait())
3840

3941
XCTAssertNoThrow(try channel.connect(to: SocketAddress(ipAddress: "127.0.0.1", port: 1)).wait())
4042

Tests/SwiftDocCUtilitiesTests/PreviewServer/ServerTestUtils.swift

+2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ func responseWithPipeline(request: HTTPRequestHead, handler factory: RequestHand
9292

9393
let response = Response()
9494

95+
XCTAssertNoThrow(try channel.pipeline.addHandler(HTTPResponseEncoder()).wait(), file: (file), line: line)
9596
XCTAssertNoThrow(try channel.pipeline.addHandler(response).wait(), file: (file), line: line)
9697
XCTAssertNoThrow(try channel.pipeline.addHandler(channelHandler).wait(), file: (file), line: line)
98+
XCTAssertNoThrow(try channel.pipeline.addHandler(HTTPServerPipelineHandler()).wait(), file: (file), line: line)
9799

98100
XCTAssertNoThrow(try channel.connect(to: SocketAddress(ipAddress: "127.0.0.1", port: 1)).wait(), file: (file), line: line)
99101

bin/check-source

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ for language in swift-or-c bash md-or-tutorial html docker; do
4444
declare -a matching_files
4545
declare -a exceptions
4646
declare -a reader
47+
expections=( )
4748
matching_files=( -name '*' )
4849
reader=head
4950
case "$language" in
@@ -135,7 +136,6 @@ EOF
135136
cd "$here/.."
136137
find . \
137138
\( \! -path './.build/*' -a \
138-
\! -path './bin/benchmark/.build/*' -a \
139139
\! -name '.' -a \
140140
\( "${matching_files[@]}" \) -a \
141141
\( \! \( "${exceptions[@]}" \) \) \) | while read line; do

0 commit comments

Comments
 (0)