Skip to content

Commit 874e401

Browse files
Merge pull request #336 from pusher/tech/swiftlint-improvements
SwiftLint improvements
2 parents f8f8154 + 627d940 commit 874e401

37 files changed

+148
-140
lines changed

.swiftlint.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ excluded:
44
- Consumption-Tests/*/Carthage
55
- Consumption-Tests/*/Pods
66

7+
opt_in_rules:
8+
- anyobject_protocol
9+
- closure_end_indentation
10+
- closure_spacing
11+
- explicit_init
12+
- modifier_order
13+
- prefer_self_type_over_type_of_self
14+
- sorted_imports
15+
- test_case_accessibility
16+
- unneeded_parentheses_in_closure_argument
17+
- vertical_whitespace_between_cases
18+
- vertical_whitespace_closing_braces
19+
720
identifier_name:
821
excluded:
922
- id

Consumption-Tests/Shared/Swift/iOS/AppDelegate.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2020
}
2121

2222
#endif
23-
2423
}

Consumption-Tests/Shared/Swift/iOS/ViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ class ViewController: UIViewController {
1717
super.viewDidLoad()
1818
self.pusher = makeAndLaunchPusher()
1919
}
20-
2120
}

Consumption-Tests/Shared/Swift/macOS/AppDelegate.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ class AppDelegate: NSObject, NSApplicationDelegate {
1010
func applicationWillTerminate(_ aNotification: Notification) {
1111
// Insert code here to tear down your application
1212
}
13-
1413
}

Consumption-Tests/Shared/Swift/macOS/ViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ class ViewController: NSViewController {
99
super.viewDidLoad()
1010
self.pusher = makeAndLaunchPusher()
1111
}
12-
1312
}

Consumption-Tests/Shared/Swift/tvOS/AppDelegate.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2626
func applicationDidBecomeActive(_ application: UIApplication) {
2727
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
2828
}
29-
3029
}

Consumption-Tests/Shared/Swift/tvOS/ViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ class ViewController: UIViewController {
1717
super.viewDidLoad()
1818
self.pusher = makeAndLaunchPusher()
1919
}
20-
2120
}

Sources/Extensions/PusherWebsocketDelegate.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ extension PusherConnection: WebSocketConnectionDelegate {
101101
switch result {
102102
case .success:
103103
updateConnectionState(to: .reconnecting)
104+
104105
case .failure(let error):
105106
PusherLogger.shared.debug(for: .errorReceived,
106107
context: """
@@ -201,8 +202,10 @@ extension PusherConnection: WebSocketConnectionDelegate {
201202
switch closeCode {
202203
case .protocolCode(let definedCode):
203204
rawCode = definedCode.rawValue
205+
204206
case .applicationCode(let applicationCode):
205207
rawCode = applicationCode
208+
206209
case .privateCode(let protocolCode):
207210
rawCode = protocolCode
208211
@unknown default:

Sources/Helpers/PusherCrypto.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Foundation
21
import CommonCrypto
2+
import Foundation
33

44
struct PusherCrypto {
55

Sources/Helpers/PusherEventFactory.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Foundation
33
protocol PusherEventFactory {
44

55
func makeEvent(fromJSON json: PusherEventPayload, withDecryptionKey decryptionKey: String?) throws -> PusherEvent
6-
76
}
87

98
// MARK: - Concrete implementation
@@ -54,5 +53,4 @@ enum PusherEventError: Error {
5453
case invalidFormat
5554
case invalidDecryptionKey
5655
case invalidEncryptedData
57-
5856
}

0 commit comments

Comments
 (0)