Skip to content

Commit 05d0d32

Browse files
authored
Fix formatting in swift-format 6.2 (#159)
### Motivation Formatter got upgraded upstream, so we need to update formatting in our project. ### Modifications Regenerated using swift-format from Swift 6.2 and made a few manual fixes. ### Result Soundness format is clean again. ### Test Plan Ran locally.
1 parent 7722cf8 commit 05d0d32

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

Sources/OpenAPIRuntime/Interface/ErrorHandlingMiddleware.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public struct ErrorHandlingMiddleware: ServerMiddleware {
5252
body: OpenAPIRuntime.HTTPBody?,
5353
metadata: OpenAPIRuntime.ServerRequestMetadata,
5454
operationID: String,
55-
next: @Sendable (HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata)
55+
next:
56+
@Sendable (HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata)
5657
async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?)
5758
) async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) {
5859
do { return try await next(request, body, metadata) } catch {

Sources/OpenAPIRuntime/Interface/ServerTransport.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ public protocol ServerTransport {
114114
/// - Important: The `path` can have mixed components, such
115115
/// as `/file/{name}.zip`.
116116
func register(
117-
_ handler: @Sendable @escaping (HTTPRequest, HTTPBody?, ServerRequestMetadata) async throws -> (
118-
HTTPResponse, HTTPBody?
119-
),
117+
_ handler:
118+
@Sendable @escaping (HTTPRequest, HTTPBody?, ServerRequestMetadata) async throws -> (
119+
HTTPResponse, HTTPBody?
120+
),
120121
method: HTTPRequest.Method,
121122
path: String
122123
) throws

Sources/OpenAPIRuntime/Interface/UniversalServer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ import struct Foundation.URLComponents
9191
metadata: ServerRequestMetadata,
9292
forOperation operationID: String,
9393
using handlerMethod: @Sendable @escaping (APIHandler) -> ((OperationInput) async throws -> OperationOutput),
94-
deserializer: @Sendable @escaping (HTTPRequest, HTTPBody?, ServerRequestMetadata) async throws ->
95-
OperationInput,
94+
deserializer:
95+
@Sendable @escaping (HTTPRequest, HTTPBody?, ServerRequestMetadata) async throws -> OperationInput,
9696
serializer: @Sendable @escaping (OperationOutput, HTTPRequest) throws -> (HTTPResponse, HTTPBody?)
9797
) async throws -> (HTTPResponse, HTTPBody?) where OperationInput: Sendable, OperationOutput: Sendable {
9898
@Sendable func wrappingErrors<R>(work: () async throws -> R, mapError: (any Error) -> any Error) async throws

Tests/OpenAPIRuntimeTests/Base/Test_OpenAPIValue.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ struct MyAnyOf2<Value1: Codable & Hashable & Sendable, Value2: Codable & Hashabl
454454
self.value1 = value1
455455
self.value2 = value2
456456
}
457-
public init(from decoder: any Decoder) throws {
457+
init(from decoder: any Decoder) throws {
458458
var errors: [any Error] = []
459459
do { self.value1 = try .init(from: decoder) } catch { errors.append(error) }
460460
do { self.value2 = try .init(from: decoder) } catch { errors.append(error) }
@@ -465,7 +465,7 @@ struct MyAnyOf2<Value1: Codable & Hashable & Sendable, Value2: Codable & Hashabl
465465
errors: errors
466466
)
467467
}
468-
public func encode(to encoder: any Encoder) throws {
468+
func encode(to encoder: any Encoder) throws {
469469
try self.value1?.encode(to: encoder)
470470
try self.value2?.encode(to: encoder)
471471
}

Tests/OpenAPIRuntimeTests/Interface/Test_ErrorHandlingMiddleware.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ final class Test_ErrorHandlingMiddlewareTests: XCTestCase {
7272
XCTAssertEqual(responseBody, nil)
7373
}
7474

75-
private func getNextMiddleware(failurePhase: MockErrorMiddleware_Next.FailurePhase) -> @Sendable (
76-
HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata
77-
) async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) {
75+
private func getNextMiddleware(failurePhase: MockErrorMiddleware_Next.FailurePhase)
76+
-> @Sendable (HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata)
77+
async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?)
78+
{
7879
let mockNext:
7980
@Sendable (HTTPTypes.HTTPRequest, OpenAPIRuntime.HTTPBody?, OpenAPIRuntime.ServerRequestMetadata)
8081
async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) = { request, body, metadata in

Tests/OpenAPIRuntimeTests/URICoder/Parsing/Test_URIParser.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,6 @@ final class Test_URIParser: Test_Runtime {
524524
}
525525
var result: ExpectedResult
526526

527-
init(string: String, result: ExpectedResult) {
528-
self.string = string
529-
self.result = result
530-
}
531-
532527
static func assert(_ string: String, equals value: RootType) -> Self {
533528
.init(string: string, result: .success(value))
534529
}

0 commit comments

Comments
 (0)