Browse Source

Update formatting.

Jon Shier 2 years ago
parent
commit
619ceb9b69

+ 1 - 1
.swiftformat

@@ -10,7 +10,7 @@
 
 # format options
 
---closingparen same-line
+--closingparen balanced
 --commas inline
 --comments indent
 --decimalgrouping 3,5

+ 2 - 1
Source/NetworkReachabilityManager.swift

@@ -194,7 +194,8 @@ open class NetworkReachabilityManager {
                 let description = weakManager.manager?.flags?.readableDescription ?? "nil"
 
                 return Unmanaged.passRetained(description as CFString)
-            })
+            }
+        )
         let callback: SCNetworkReachabilityCallBack = { _, flags, info in
             guard let info = info else { return }
 

+ 1 - 1
Source/ParameterEncoding.swift

@@ -98,7 +98,7 @@ public struct URLEncoding: ParameterEncoding {
                 return key
             case .indexInBrackets:
                 return "\(key)[\(index)]"
-            case let .custom(encoding): 
+            case let .custom(encoding):
                 return encoding(key, index)
             }
         }

+ 3 - 3
Tests/ParameterEncoderTests.swift

@@ -626,9 +626,9 @@ final class URLEncodedFormEncoderTests: BaseTestCase {
 
     func testThatArraysCanBeEncodedWithCustomClosure() {
         // Given
-        let encoder = URLEncodedFormEncoder(arrayEncoding: .custom({ key, index in
-          "\(key).\(index + 1)"
-        }))
+        let encoder = URLEncodedFormEncoder(arrayEncoding: .custom { key, index in
+            "\(key).\(index + 1)"
+        })
         let parameters = ["array": [1, 2]]
 
         // When

+ 3 - 3
Tests/ParameterEncodingTests.swift

@@ -188,9 +188,9 @@ final class URLParameterEncodingTestCase: ParameterEncodingTestCase {
 
     func testURLParameterEncodeStringKeyArrayValueParameterWithCustomClosure() throws {
         // Given
-        let encoding = URLEncoding(arrayEncoding: .custom({ key, index in
-          "\(key).\(index + 1)"
-        }))
+        let encoding = URLEncoding(arrayEncoding: .custom { key, index in
+            "\(key).\(index + 1)"
+        })
         let parameters = ["foo": ["a", 1, true]]
 
         // When