Skip to content

Commit 958583a

Browse files
Prachi Gauriarprachigauriar
authored andcommitted
Fix compilation errors (and lint warnings) in Xcode 26.4 RC1
1 parent 1764b4f commit 958583a

66 files changed

Lines changed: 256 additions & 231 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.swiftpm/xcode/xcshareddata/xcschemes/dfob.xcscheme

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@
3434
default = "YES">
3535
</TestPlanReference>
3636
</TestPlans>
37+
<Testables>
38+
<TestableReference
39+
skipped = "NO">
40+
<BuildableReference
41+
BuildableIdentifier = "primary"
42+
BlueprintIdentifier = "DevFoundationTests"
43+
BuildableName = "DevFoundationTests"
44+
BlueprintName = "DevFoundationTests"
45+
ReferencedContainer = "container:">
46+
</BuildableReference>
47+
</TestableReference>
48+
</Testables>
3749
</TestAction>
3850
<LaunchAction
3951
buildConfiguration = "Debug"

Scripts/format

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Get the directory where this script is located
4+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5+
6+
# Go to the repository root (one level up from Scripts)
7+
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
8+
9+
# Run swift format with --in-place to fix formatting issues
10+
swift format --in-place --recursive \
11+
"$REPO_ROOT/Packages/" \
12+
"$REPO_ROOT/Sources/" \
13+
"$REPO_ROOT/Tests/"

Sources/DevFoundation/Concurrency/DispatchQueue+NonOvercommitting.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ extension DispatchQueue {
2525
label: String,
2626
qos: DispatchQoS = .unspecified,
2727
attributes: DispatchQueue.Attributes = [],
28-
autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency = .inherit
28+
autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency = .inherit,
2929
) -> DispatchQueue {
3030
return .init(
3131
label: label,
3232
qos: qos,
3333
attributes: attributes,
3434
autoreleaseFrequency: autoreleaseFrequency,
35-
target: .global(qos: qos.qosClass)
35+
target: .global(qos: qos.qosClass),
3636
)
3737
}
3838
}

Sources/DevFoundation/Concurrency/DispatchQueue+Standard.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ extension DispatchQueue {
1414
/// queue uses `.utility` for its quality-of-service.
1515
public static let utility: DispatchQueue = .makeNonOvercommitting(
1616
label: reverseDNSPrefixed("utility"),
17-
qos: .utility
17+
qos: .utility,
1818
)
1919
}

Sources/DevFoundation/Concurrency/ExecutionGroup.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public final class ExecutionGroup: Sendable {
8383
@discardableResult
8484
public func addTask<Success>(
8585
priority: TaskPriority? = nil,
86-
operation: @escaping @Sendable @isolated(any) () async -> Success
86+
operation: @escaping @Sendable @isolated(any) () async -> Success,
8787
) -> Task<Success, Never> {
8888
incrementTaskCount()
8989

@@ -103,7 +103,7 @@ public final class ExecutionGroup: Sendable {
103103
@discardableResult
104104
public func addTask<Success>(
105105
priority: TaskPriority? = nil,
106-
operation: @escaping @Sendable @isolated(any) () async throws -> Success
106+
operation: @escaping @Sendable @isolated(any) () async throws -> Success,
107107
) -> Task<Success, any Error> where Success: Sendable {
108108
incrementTaskCount()
109109

Sources/DevFoundation/Concurrency/WithTimeout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import Foundation
2828
public func withTimeout<Success, Failure>(
2929
_ timeout: Duration,
3030
priority: TaskPriority? = nil,
31-
operation: @escaping @Sendable () async throws(Failure) -> Success
31+
operation: @escaping @Sendable () async throws(Failure) -> Success,
3232
) async throws -> Success
3333
where Success: Sendable, Failure: Error {
3434
let deadline = ContinuousClock.Instant.now + timeout

Sources/DevFoundation/Event Bus/ContextualBusEventObserver.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final class ContextualBusEventObserver<Context>: BusEventObserver where C
5252
@discardableResult
5353
public func addHandler<Event>(
5454
for eventType: Event.Type,
55-
body: @escaping @Sendable (Event, inout Context) -> Void
55+
body: @escaping @Sendable (Event, inout Context) -> Void,
5656
) -> AnyObject where Event: BusEvent {
5757
let key = EventHandlerKey(eventType: eventType)
5858
let handler = Handler<Event>(body: body, eventID: nil)
@@ -76,7 +76,7 @@ public final class ContextualBusEventObserver<Context>: BusEventObserver where C
7676
public func addHandler<Event>(
7777
for eventType: Event.Type,
7878
id: Event.ID,
79-
body: @escaping @Sendable (Event, inout Context) -> Void
79+
body: @escaping @Sendable (Event, inout Context) -> Void,
8080
) -> AnyObject where Event: BusEvent & Identifiable, Event.ID: Sendable {
8181
let key = IdentifiableEventHandlerKey(eventType: eventType, eventID: id)
8282
let handler = Handler<Event>(body: body, eventID: AnySendableHashable(id))
@@ -252,7 +252,7 @@ extension ContextualBusEventObserver {
252252
/// - The event ID with which the handler was added.
253253
init(
254254
body: @escaping @Sendable (Event, inout Context) -> Void,
255-
eventID: AnySendableHashable?
255+
eventID: AnySendableHashable?,
256256
) {
257257
self.body = body
258258
self.eventID = eventID
@@ -283,7 +283,7 @@ extension ContextualBusEventObserver {
283283
/// The serial executor on which this actor’s jobs are executed.
284284
private let serialExecutor = DispatchSerialQueue(
285285
label: reverseDNSPrefixed("contextual-bus-event-observer"),
286-
target: .utility
286+
target: .utility,
287287
)
288288

289289

@@ -308,7 +308,7 @@ extension ContextualBusEventObserver {
308308

309309

310310
nonisolated var unownedExecutor: UnownedSerialExecutor {
311-
return .init(serialExecutor)
311+
return .init(complexEquality: serialExecutor)
312312
}
313313
}
314314
}

Sources/DevFoundation/Extensions/Data+Obfuscation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension Data {
2222
public func obfuscated<MessageSize, KeySize>(
2323
withKey key: Data,
2424
keySizeType: KeySize.Type,
25-
messageSizeType: MessageSize.Type
25+
messageSizeType: MessageSize.Type,
2626
) throws -> Data
2727
where
2828
KeySize: FixedWidthInteger,
@@ -55,7 +55,7 @@ extension Data {
5555
/// - messageSizeType: The message size type used to obfuscate the data.
5656
public func deobfuscated<MessageSize, KeySize>(
5757
keySizeType: KeySize.Type,
58-
messageSizeType: MessageSize.Type
58+
messageSizeType: MessageSize.Type,
5959
) throws -> Data
6060
where
6161
KeySize: FixedWidthInteger & Sendable,
@@ -88,7 +88,7 @@ extension Data {
8888
/// be extracted.
8989
private func extractFieldData<FieldSize>(
9090
at index: Int,
91-
sizeType: FieldSize.Type
91+
sizeType: FieldSize.Type,
9292
) -> (Data, Int)?
9393
where FieldSize: FixedWidthInteger & Sendable {
9494
let fieldSizeEndIndex = index + FieldSize.byteWidth

Sources/DevFoundation/Networking/HTTP Client/HTTPClient.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public final class HTTPClient<RequestContext>: Sendable where RequestContext: Se
4747
public init(
4848
urlRequestLoader: any URLRequestLoader,
4949
interceptors: [any HTTPClientInterceptor<RequestContext>] = [],
50-
retryPolicy: (any RetryPolicy<(URLRequest, RequestContext), Result<HTTPResponse<Data>, any Error>>)? = nil
50+
retryPolicy: (any RetryPolicy<(URLRequest, RequestContext), Result<HTTPResponse<Data>, any Error>>)? = nil,
5151
) {
5252
self.urlRequestLoader = urlRequestLoader
5353
self.interceptors = interceptors
@@ -90,7 +90,7 @@ public final class HTTPClient<RequestContext>: Sendable where RequestContext: Se
9090
_ urlRequest: URLRequest,
9191
context: RequestContext,
9292
attemptCount: Int,
93-
initialDelay: Duration
93+
initialDelay: Duration,
9494
) async throws -> HTTPResponse<Data> {
9595
if initialDelay != .zero {
9696
try Task.checkCancellation()
@@ -107,7 +107,7 @@ public final class HTTPClient<RequestContext>: Sendable where RequestContext: Se
107107
forInput: (urlRequest, context),
108108
output: result,
109109
attemptCount: attemptCount,
110-
previousDelay: initialDelay
110+
previousDelay: initialDelay,
111111
)
112112
else {
113113
return try result.get()
@@ -131,7 +131,7 @@ public final class HTTPClient<RequestContext>: Sendable where RequestContext: Se
131131
private func load(
132132
_ urlRequest: URLRequest,
133133
context: RequestContext,
134-
interceptorIndex: Int
134+
interceptorIndex: Int,
135135
) async throws -> HTTPResponse<Data> {
136136
// If we’re out of interceptors, load the data
137137
guard interceptorIndex < interceptors.endIndex else {
@@ -147,7 +147,7 @@ public final class HTTPClient<RequestContext>: Sendable where RequestContext: Se
147147
// Otherwise, pass the interceptor our data and call the next one
148148
return try await interceptors[interceptorIndex].intercept(
149149
request: urlRequest,
150-
context: context
150+
context: context,
151151
) { (request, context) in
152152
return try await load(request, context: context, interceptorIndex: interceptorIndex + 1)
153153
}

Sources/DevFoundation/Networking/HTTP Client/HTTPClientInterceptor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public protocol HTTPClientInterceptor<RequestContext>: Sendable {
2929
next: (
3030
_ request: URLRequest,
3131
_ context: RequestContext
32-
) async throws -> HTTPResponse<Data>
32+
) async throws -> HTTPResponse<Data>,
3333
) async throws -> HTTPResponse<Data>
3434
}

0 commit comments

Comments
 (0)