Skip to content

Commit 275c51c

Browse files
author
Daniel Browne
committed
Enable 'modifier_order' SwiftLint rule
1 parent 11149f0 commit 275c51c

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.swiftlint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ opt_in_rules:
99
- closure_end_indentation
1010
- closure_spacing
1111
- explicit_init
12+
- modifier_order
1213
- vertical_whitespace_between_cases
1314
- vertical_whitespace_closing_braces
1415

Sources/ObjC/ObjectiveC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public extension PusherHost {
137137
var host: String?
138138
var cluster: String?
139139

140-
public override init() {
140+
override public init() {
141141
self.type = 2
142142
}
143143

Tests/Helpers/Mocks.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ open class MockWebSocket: NWWebSocket {
2626
self.eventGivenToCallback = event
2727
}
2828

29-
open override func connect() {
29+
override open func connect() {
3030
let connectionEstablishedString = "{\"event\":\"pusher:connection_established\",\"data\":\"{\\\"socket_id\\\":\\\"45481.3166671\\\",\\\"activity_timeout\\\":120}\"}"
3131
_ = stubber.stub(
3232
functionName: "connect",
@@ -42,7 +42,7 @@ open class MockWebSocket: NWWebSocket {
4242
)
4343
}
4444

45-
open override func disconnect(closeCode: NWProtocolWebSocket.CloseCode = .protocolCode(.normalClosure)) {
45+
override open func disconnect(closeCode: NWProtocolWebSocket.CloseCode = .protocolCode(.normalClosure)) {
4646
_ = stubber.stub(
4747
functionName: "disconnect",
4848
args: nil,
@@ -55,7 +55,7 @@ open class MockWebSocket: NWWebSocket {
5555
}
5656

5757
// swiftlint:disable:next function_body_length cyclomatic_complexity
58-
open override func send(string: String) {
58+
override open func send(string: String) {
5959
if string == "{\"data\":{\"channel\":\"test-channel\"},\"event\":\"pusher:subscribe\"}" || string == "{\"event\":\"pusher:subscribe\",\"data\":{\"channel\":\"test-channel\"}}" {
6060
_ = stubber.stub(
6161
functionName: "writeString",
@@ -235,7 +235,7 @@ open class MockPusherConnection: PusherConnection {
235235
super.init(key: "key", socket: MockWebSocket(), url: "ws://blah.blah:80", options: options)
236236
}
237237

238-
open override func handleEvent(event: PusherEvent) {
238+
override open func handleEvent(event: PusherEvent) {
239239
_ = stubber.stub(
240240
functionName: "handleEvent",
241241
args: [event],
@@ -291,9 +291,9 @@ open class FunctionCall {
291291
public typealias Response = (data: Data?, urlResponse: URLResponse?, error: NSError?)
292292

293293
public class MockSession: URLSession {
294-
static public var mockResponses: [String: Response] = [:]
294+
public static var mockResponses: [String: Response] = [:]
295295
// swiftlint:disable:next large_tuple
296-
static public var mockResponse: (data: Data?, urlResponse: URLResponse?, error: NSError?) = (data: nil, urlResponse: nil, error: nil)
296+
public static var mockResponse: (data: Data?, urlResponse: URLResponse?, error: NSError?) = (data: nil, urlResponse: nil, error: nil)
297297

298298
override public class var shared: URLSession {
299299
return MockSession()

0 commit comments

Comments
 (0)