Skip to content

Commit 607e3b3

Browse files
committed
Label closure parameters in public APIs
1 parent 23c6b9b commit 607e3b3

15 files changed

+83
-78
lines changed

Sources/Configuration/ConfigProvider.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public protocol ConfigProvider: Sendable {
101101
forKey key: AbsoluteConfigKey,
102102
type: ConfigType,
103103
updatesHandler: (
104-
ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>
104+
_ updates: ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>
105105
) async throws -> Return
106106
) async throws -> Return
107107

@@ -129,7 +129,7 @@ public protocol ConfigProvider: Sendable {
129129
/// - Throws: Provider-specific errors or errors thrown by the handler closure.
130130
/// - Returns: The value returned by the closure.
131131
func watchSnapshot<Return>(
132-
updatesHandler: (ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
132+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
133133
) async throws -> Return
134134
}
135135

Sources/Configuration/ConfigProviderHelpers.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extension ConfigProvider {
3030
/// func watchValue(
3131
/// forKey: AbsoluteConfigKey,
3232
/// type: ConfigType,
33-
/// updatesHandler: (ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>) async throws -> Void
33+
/// updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>) async throws -> Void
3434
/// ) async throws {
3535
/// try await watchValueFromValue(forKey: key, type: type, updatesHandler: updatesHandler)
3636
/// }
@@ -47,7 +47,7 @@ extension ConfigProvider {
4747
forKey key: AbsoluteConfigKey,
4848
type: ConfigType,
4949
updatesHandler: (
50-
ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>
50+
_ updates: ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>
5151
) async throws -> Return
5252
) async throws -> Return
5353
{
@@ -76,7 +76,7 @@ extension ConfigProvider {
7676
///
7777
/// ```swift
7878
/// func watchSnapshot(
79-
/// updatesHandler: (ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Void
79+
/// updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Void
8080
/// ) async throws {
8181
/// try await watchSnapshotFromSnapshot(updatesHandler)
8282
/// }
@@ -86,7 +86,7 @@ extension ConfigProvider {
8686
/// - Returns: The value returned by the handler closure.
8787
/// - Throws: Provider-specific errors or errors thrown by the handler.
8888
nonisolated(nonsending) public func watchSnapshotFromSnapshot<Return>(
89-
updatesHandler: (ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
89+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
9090
) async throws -> Return {
9191
let (stream, continuation) = AsyncStream<any ConfigSnapshot>
9292
.makeStream(bufferingPolicy: .bufferingNewest(1))

Sources/Configuration/ConfigReader+methods.swift

Lines changed: 42 additions & 42 deletions
Large diffs are not rendered by default.

Sources/Configuration/ConfigReader+methods.swift.gyb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ extension ConfigReader {
703703
isSecret: Bool = false,
704704
fileID: String = #fileID,
705705
line: UInt = #line,
706-
updatesHandler: (ConfigUpdatesAsyncSequence<${primitive_type["type"]}?, Never>) async throws -> Return
706+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<${primitive_type["type"]}?, Never>) async throws -> Return
707707
) async throws -> Return {
708708
try await watchValue(
709709
forKey: key,
@@ -747,7 +747,7 @@ extension ConfigReader {
747747
default defaultValue: ${primitive_type["type"]},
748748
fileID: String = #fileID,
749749
line: UInt = #line,
750-
updatesHandler: (ConfigUpdatesAsyncSequence<${primitive_type["type"]}, Never>) async throws -> Return
750+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<${primitive_type["type"]}, Never>) async throws -> Return
751751
) async throws -> Return {
752752
try await watchValue(
753753
forKey: key,
@@ -790,7 +790,7 @@ extension ConfigReader {
790790
isSecret: Bool = false,
791791
fileID: String = #fileID,
792792
line: UInt = #line,
793-
updatesHandler: (ConfigUpdatesAsyncSequence<${primitive_type["type"]}, any Error>) async throws -> Return
793+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<${primitive_type["type"]}, any Error>) async throws -> Return
794794
) async throws -> Return {
795795
try await watchRequiredValue(
796796
forKey: key,
@@ -840,7 +840,7 @@ extension ConfigReader {
840840
isSecret: Bool = false,
841841
fileID: String = #fileID,
842842
line: UInt = #line,
843-
updatesHandler: (ConfigUpdatesAsyncSequence<Value?, Never>) async throws -> Return
843+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<Value?, Never>) async throws -> Return
844844
) async throws -> Return {
845845
try await watchValue(
846846
forKey: key,
@@ -886,7 +886,7 @@ extension ConfigReader {
886886
default defaultValue: Value,
887887
fileID: String = #fileID,
888888
line: UInt = #line,
889-
updatesHandler: (ConfigUpdatesAsyncSequence<Value, Never>) async throws -> Return
889+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<Value, Never>) async throws -> Return
890890
) async throws -> Return {
891891
try await watchValue(
892892
forKey: key,
@@ -931,7 +931,7 @@ extension ConfigReader {
931931
isSecret: Bool = false,
932932
fileID: String = #fileID,
933933
line: UInt = #line,
934-
updatesHandler: (ConfigUpdatesAsyncSequence<Value, any Error>) async throws -> Return
934+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<Value, any Error>) async throws -> Return
935935
) async throws -> Return {
936936
try await watchRequiredValue(
937937
forKey: key,
@@ -979,7 +979,7 @@ extension ConfigReader {
979979
isSecret: Bool = false,
980980
fileID: String = #fileID,
981981
line: UInt = #line,
982-
updatesHandler: (ConfigUpdatesAsyncSequence<[Value]?, Never>) async throws -> Return
982+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<[Value]?, Never>) async throws -> Return
983983
) async throws -> Return {
984984
try await watchValue(
985985
forKey: key,
@@ -1025,7 +1025,7 @@ extension ConfigReader {
10251025
default defaultValue: [Value],
10261026
fileID: String = #fileID,
10271027
line: UInt = #line,
1028-
updatesHandler: (ConfigUpdatesAsyncSequence<[Value], Never>) async throws -> Return
1028+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<[Value], Never>) async throws -> Return
10291029
) async throws -> Return {
10301030
try await watchValue(
10311031
forKey: key,
@@ -1070,7 +1070,7 @@ extension ConfigReader {
10701070
isSecret: Bool = false,
10711071
fileID: String = #fileID,
10721072
line: UInt = #line,
1073-
updatesHandler: (ConfigUpdatesAsyncSequence<[Value], any Error>) async throws -> Return
1073+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<[Value], any Error>) async throws -> Return
10741074
) async throws -> Return {
10751075
try await watchRequiredValue(
10761076
forKey: key,

Sources/Configuration/ConfigSnapshotReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ extension ConfigReader {
281281
public func watchSnapshot<Return>(
282282
fileID: String = #fileID,
283283
line: UInt = #line,
284-
updatesHandler: (ConfigUpdatesAsyncSequence<ConfigSnapshotReader, Never>) async throws -> Return
284+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<ConfigSnapshotReader, Never>) async throws -> Return
285285
) async throws -> Return {
286286
try await provider.watchSnapshot { updates in
287287
try await updatesHandler(

Sources/Configuration/Providers/CLI/CommandLineArgumentsProvider.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ extension CommandLineArgumentsProvider: ConfigProvider {
153153
public func watchValue<Return>(
154154
forKey key: AbsoluteConfigKey,
155155
type: ConfigType,
156-
updatesHandler: (ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>) async throws -> Return
156+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>) async throws ->
157+
Return
157158
) async throws -> Return {
158159
try await watchValueFromValue(forKey: key, type: type, updatesHandler: updatesHandler)
159160
}
@@ -165,7 +166,7 @@ extension CommandLineArgumentsProvider: ConfigProvider {
165166

166167
// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
167168
public func watchSnapshot<Return>(
168-
updatesHandler: (ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
169+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
169170
) async throws -> Return {
170171
try await watchSnapshotFromSnapshot(updatesHandler: updatesHandler)
171172
}

Sources/Configuration/Providers/EnvironmentVariables/EnvironmentVariablesProvider.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ extension EnvironmentVariablesProvider: ConfigProvider {
489489
public func watchValue<Return>(
490490
forKey key: AbsoluteConfigKey,
491491
type: ConfigType,
492-
updatesHandler: (ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>) async throws -> Return
492+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>) async throws ->
493+
Return
493494
) async throws -> Return {
494495
try await watchValueFromValue(forKey: key, type: type, updatesHandler: updatesHandler)
495496
}
@@ -501,7 +502,7 @@ extension EnvironmentVariablesProvider: ConfigProvider {
501502

502503
// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
503504
public func watchSnapshot<Return>(
504-
updatesHandler: (ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
505+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
505506
) async throws -> Return {
506507
try await watchSnapshotFromSnapshot(updatesHandler: updatesHandler)
507508
}

Sources/Configuration/Providers/Files/DirectoryFilesProvider.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ extension DirectoryFilesProvider: ConfigProvider {
427427
public func watchValue<Return>(
428428
forKey key: AbsoluteConfigKey,
429429
type: ConfigType,
430-
updatesHandler: (ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>) async throws -> Return
430+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>) async throws ->
431+
Return
431432
) async throws -> Return {
432433
try await watchValueFromValue(forKey: key, type: type, updatesHandler: updatesHandler)
433434
}
@@ -439,7 +440,7 @@ extension DirectoryFilesProvider: ConfigProvider {
439440

440441
// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
441442
public func watchSnapshot<Return>(
442-
updatesHandler: (ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
443+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
443444
) async throws -> Return {
444445
try await watchSnapshotFromSnapshot(updatesHandler: updatesHandler)
445446
}

Sources/Configuration/Providers/Files/FileProvider.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ extension FileProvider: ConfigProvider {
178178

179179
// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
180180
public func watchSnapshot<Return>(
181-
updatesHandler: (ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
181+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
182182
) async throws -> Return {
183183
try await watchSnapshotFromSnapshot(updatesHandler: updatesHandler)
184184
}
@@ -188,7 +188,7 @@ extension FileProvider: ConfigProvider {
188188
forKey key: AbsoluteConfigKey,
189189
type: ConfigType,
190190
updatesHandler: (
191-
ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>
191+
_ updates: ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>
192192
) async throws -> Return
193193
) async throws -> Return {
194194
try await watchValueFromValue(forKey: key, type: type, updatesHandler: updatesHandler)

Sources/Configuration/Providers/Files/ReloadingFileProvider.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,8 @@ extension ReloadingFileProvider: ConfigProvider {
462462
public func watchValue<Return>(
463463
forKey key: AbsoluteConfigKey,
464464
type: ConfigType,
465-
updatesHandler: (ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>) async throws -> Return
465+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<Result<LookupResult, any Error>, Never>) async throws ->
466+
Return
466467
) async throws -> Return {
467468
let (stream, continuation) = AsyncStream<Result<LookupResult, any Error>>
468469
.makeStream(bufferingPolicy: .bufferingNewest(1))
@@ -495,7 +496,7 @@ extension ReloadingFileProvider: ConfigProvider {
495496

496497
// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
497498
public func watchSnapshot<Return>(
498-
updatesHandler: (ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
499+
updatesHandler: (_ updates: ConfigUpdatesAsyncSequence<any ConfigSnapshot, Never>) async throws -> Return
499500
) async throws -> Return {
500501
let (stream, continuation) = AsyncStream<Snapshot>.makeStream(bufferingPolicy: .bufferingNewest(1))
501502
let id = UUID()

0 commit comments

Comments
 (0)