Skip to content

Commit 9b44b5a

Browse files
committed
style: Format places not handled by ci
1 parent 5731d20 commit 9b44b5a

File tree

3 files changed

+40
-20
lines changed

3 files changed

+40
-20
lines changed

Sources/FunctionalConfigurator/Configurator.swift

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,18 @@ extension Configurator {
140140
}
141141

142142
public func callAsFunction(_ value: Value) -> Configurator {
143-
_block.configurator.appendingConfiguration { _block.keyPath.embed(value, in: $0) }
143+
_block.configurator.appendingConfiguration {
144+
_block.keyPath.embed(value, in: $0)
145+
}
144146
}
145147

146148
public func set(_ transform: @escaping (inout Value) -> Void) -> Configurator {
147149
_block.configurator.appendingConfiguration { base in
148150
_block.keyPath.embed(
149-
modification(of: _block.keyPath.extract(from: base), with: transform),
151+
modification(
152+
of: _block.keyPath.extract(from: base),
153+
with: transform
154+
),
150155
in: base
151156
)
152157
}
@@ -157,7 +162,10 @@ extension Configurator {
157162
) -> Configurator {
158163
_block.configurator.appendingConfiguration { base in
159164
_block.keyPath.embed(
160-
_modification(of: _block.keyPath.extract(from: base), with: configuration),
165+
_modification(
166+
of: _block.keyPath.extract(from: base),
167+
with: configuration
168+
),
161169
in: base
162170
)
163171
}
@@ -167,7 +175,9 @@ extension Configurator {
167175
_ configuration: @escaping (Configurator<Wrapped>) -> Configurator<Wrapped>
168176
) -> Configurator where Value == Wrapped? {
169177
_block.configurator.appendingConfiguration { base in
170-
guard let value = _block.keyPath.extract(from: base) else { return base }
178+
guard let value = _block.keyPath.extract(from: base)
179+
else { return base }
180+
171181
return _block.keyPath.embed(
172182
_modification(of: value, with: configuration),
173183
in: base
@@ -180,7 +190,8 @@ extension Configurator {
180190
) -> CallableBlock<LocalValue> {
181191
CallableBlock<LocalValue>(
182192
configurator: _block.configurator,
183-
keyPath: _block.keyPath.appending(path: FunctionalKeyPath(keyPath))
193+
keyPath: _block.keyPath
194+
.appending(path: FunctionalKeyPath(keyPath))
184195
)
185196
}
186197

@@ -195,7 +206,9 @@ extension Configurator {
195206
) -> CallableBlock<LocalValue?> where Value == Wrapped? {
196207
CallableBlock<LocalValue?>(
197208
configurator: _block.configurator,
198-
keyPath: _block.keyPath.appending(path: FunctionalKeyPath(keyPath).optional())
209+
keyPath: _block.keyPath.appending(
210+
path: FunctionalKeyPath(keyPath).optional()
211+
)
199212
)
200213
}
201214

@@ -216,7 +229,10 @@ extension Configurator {
216229
) -> Configurator where Value: AnyObject {
217230
configurator.appendingConfiguration { base in
218231
keyPath.embed(
219-
_modification(of: keyPath.extract(from: base), with: configuration),
232+
_modification(
233+
of: keyPath.extract(from: base),
234+
with: configuration
235+
),
220236
in: base
221237
)
222238
}
@@ -226,7 +242,9 @@ extension Configurator {
226242
_ configuration: @escaping (Configurator<Wrapped>) -> Configurator<Wrapped>
227243
) -> Configurator where Wrapped: AnyObject, Value == Wrapped? {
228244
configurator.appendingConfiguration { base in
229-
guard let value = keyPath.extract(from: base) else { return base }
245+
guard let value = keyPath.extract(from: base)
246+
else { return base }
247+
230248
return keyPath.embed(
231249
_modification(of: value, with: configuration),
232250
in: base

Sources/FunctionalKeyPath/FunctionalKeyPath.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ public struct FunctionalKeyPath<Root, Value> {
1313
/// - Parameters:
1414
/// - embed: A function that always succeeds in embedding a value in a root.
1515
/// - extract: A function that can optionally fail in extracting a value from a root.
16-
public init(embed: @escaping (Value, Root) -> Root, extract: @escaping (Root) -> Value) {
16+
public init(
17+
embed: @escaping (Value, Root) -> Root,
18+
extract: @escaping (Root) -> Value
19+
) {
1720
self._embed = embed
1821
self._extract = extract
1922
}

Tests/DeclarativeConfigurationTests/BuilderTests.swift

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,16 @@ final class BuilderTests: XCTestCase {
9191

9292
let initial = Container()
9393
let actual = Container().builder
94-
.content.scope {
95-
$0
96-
.a(1)
97-
.b(2)
98-
.c(3)
99-
.innerClass
100-
.ifLetScope {
101-
$0
102-
.value(1)
103-
}
104-
}.build()
94+
.content.scope { $0
95+
.a(1)
96+
.b(2)
97+
.c(3)
98+
.innerClass
99+
.ifLetScope { $0
100+
.value(1)
101+
}
102+
}
103+
.build()
105104

106105
XCTAssertNotEqual(actual.content.a, initial.content.a)
107106
XCTAssertNotEqual(actual.content.b, initial.content.b)

0 commit comments

Comments
 (0)