Skip to content

Commit 6981252

Browse files
refactor: Formatting
1 parent 4924b75 commit 6981252

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

Sources/OpenFeature/Hook.swift

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ public protocol Hook {
1111

1212
func error<HookValue>(ctx: HookContext<HookValue>, error: Error, hints: [String: Any])
1313

14-
func finally<HookValue>(ctx: HookContext<HookValue>, details: FlagEvaluationDetails<HookValue>, hints: [String: Any])
14+
func finally<HookValue>(
15+
ctx: HookContext<HookValue>,
16+
details: FlagEvaluationDetails<HookValue>,
17+
hints: [String: Any]
18+
)
1519

1620
func supportsFlagValueType(flagValueType: FlagValueType) -> Bool
1721
}
@@ -31,7 +35,9 @@ extension Hook {
3135
// Default implementation
3236
}
3337

34-
public func finally<HookValue>(ctx: HookContext<HookValue>, details: FlagEvaluationDetails<HookValue>, hints: [String: Any]) {
38+
public func finally<HookValue>(
39+
ctx: HookContext<HookValue>, details: FlagEvaluationDetails<HookValue>, hints: [String: Any]
40+
) {
3541
// Default implementation
3642
}
3743

Sources/OpenFeature/OpenFeatureClient.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ extension OpenFeatureClient {
7373
switch openFeatureApiState.providerStatus {
7474
case .fatal:
7575
details.errorCode = .providerFatal
76-
details.errorMessage = OpenFeatureError
76+
details.errorMessage =
77+
OpenFeatureError
7778
.providerFatalError(message: "unknown")
7879
.description
7980
details.reason = Reason.error.rawValue
@@ -85,7 +86,8 @@ extension OpenFeatureClient {
8586
return details
8687
case .error:
8788
details.errorCode = .general
88-
details.errorMessage = OpenFeatureError
89+
details.errorMessage =
90+
OpenFeatureError
8991
.generalError(message: "unknown")
9092
.description
9193
details.reason = Reason.error.rawValue

Tests/OpenFeatureTests/Helpers/BooleanHookMock.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class BooleanHookMock: Hook {
3838
self.addEval(self.prefix.isEmpty ? "error" : "\(self.prefix) error")
3939
}
4040

41-
func finally<HookValue>(ctx: HookContext<HookValue>, details: FlagEvaluationDetails<HookValue>, hints: [String: Any]) {
41+
func finally<HookValue>(
42+
ctx: HookContext<HookValue>, details: FlagEvaluationDetails<HookValue>, hints: [String: Any]
43+
) {
4244
finallyCalled += 1
4345
self.addEval(self.prefix.isEmpty ? "finally" : "\(self.prefix) finally")
4446
}

Tests/OpenFeatureTests/Helpers/IntHookMock.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class IntHookMock: Hook {
3838
self.addEval(self.prefix.isEmpty ? "error" : "\(self.prefix) error")
3939
}
4040

41-
func finally<HookValue>(ctx: HookContext<HookValue>, details: FlagEvaluationDetails<HookValue>, hints: [String: Any]) {
41+
func finally<HookValue>(
42+
ctx: HookContext<HookValue>, details: FlagEvaluationDetails<HookValue>, hints: [String: Any]
43+
) {
4244
finallyCalled += 1
4345
self.addEval(self.prefix.isEmpty ? "finally" : "\(self.prefix) finally")
4446
}

Tests/OpenFeatureTests/ValueTests.swift

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ final class ValueTests: XCTestCase {
7272
formatter.locale = Locale(identifier: "en_US_POSIX")
7373
formatter.timeZone = TimeZone(secondsFromGMT: 0)
7474

75-
7675
let date = try XCTUnwrap(formatter.date(from: "2022-01-01 12:00:00"))
7776

7877
let value: Value = .structure([

0 commit comments

Comments
 (0)