Skip to content

Commit cffdcaf

Browse files
committed
Fix swiftlint issues
1 parent d34e7c6 commit cffdcaf

19 files changed

+36
-14
lines changed

Tests/WordPressKitTests/CoreAPITests/WordPressComRestApiTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import OHHTTPStubsSwift
66

77
class WordPressComRestApiTests: XCTestCase {
88

9+
// swiftlint:disable operator_usage_whitespace
910
let scheme = "https"
1011
let host = "public-api.wordpress.com"
1112
let wordPressMediaRoutePath = "/rest/v1.1/sites/0/media/"
1213
let wordPressMediaNewEndpointPath = "/rest/v1.1/sites/0/media/new"
14+
// swiftlint:enable operator_usage_whitespace
1315

1416
override func setUp() {
1517
super.setUp()

Tests/WordPressKitTests/WordPressKitTests/Tests/AccountServiceRemoteRESTTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class AccountServiceRemoteRESTTests: RemoteTestCase, RESTTestable {
55

66
// MARK: - Constants
77

8+
// swiftlint:disable operator_usage_whitespace
89
let siteID = 321
910
let username = "jimthetester"
1011
let email = "[email protected]"
@@ -41,6 +42,7 @@ class AccountServiceRemoteRESTTests: RemoteTestCase, RESTTestable {
4142
let requestLinkInvalidSecretFailureMockFilename = "auth-send-login-email-invalid-secret-failure.json"
4243
let requestVerificationEmailSuccessMockFilename = "auth-send-verification-email-success.json"
4344
let requestVerificationAlreadyVerifiedFailureMockFilename = "auth-send-verification-email-already-verified-failure.json"
45+
// swiftlint:enable operator_usage_whitespace
4446

4547
// MARK: - Properties
4648

Tests/WordPressKitTests/WordPressKitTests/Tests/AccountSettingsRemoteTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class AccountSettingsRemoteTests: RemoteTestCase, RESTTestable {
55

66
// MARK: - Constants
77

8+
// swiftlint:disable operator_usage_whitespace
89
let siteID = 321
910
let username = "jimthetester"
1011
let email = "[email protected]"
@@ -36,6 +37,7 @@ class AccountSettingsRemoteTests: RemoteTestCase, RESTTestable {
3637
let updateSettingsChangeDisplayNameSuccessMockFilename = "me-settings-change-display-name-success.json"
3738
let updateSettingsChangeDisplayNameBadJsonFailureMockFilename = "me-settings-change-display-name-bad-json-failure.json"
3839
let updateSettingsInvalidInputFailureMockFilename = "me-settings-change-invalid-input-failure.json"
40+
// swiftlint:enable operator_usage_whitespace
3941

4042
let closeAccountSuccessFilename = "me-settings-close-account-success.json"
4143
let closeAccountFailureFilename = "me-settings-close-account-failure.json"

Tests/WordPressKitTests/WordPressKitTests/Tests/CommentServiceRemoteRESTTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ final class CommentServiceRemoteRESTTests: RemoteTestCase, RESTTestable {
8181
remote.getCommentWithID(NSNumber(value: commentId),
8282
success: { comment in
8383

84-
guard let comment = comment else {
84+
guard let comment else {
8585
XCTFail("Failed to retrieve mock site comment")
8686
return
8787
}

Tests/WordPressKitTests/WordPressKitTests/Tests/CommentServiceRemoteXMLRPCTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class CommentServiceRemoteXMLRPCTests: RemoteTestCase, XMLRPCTestable {
7272
remoteInstance.getCommentWithID(NSNumber(value: 1),
7373
success: { comment in
7474

75-
guard let comment = comment else {
75+
guard let comment else {
7676
XCTFail("Failed to retrieve mock site comment")
7777
return
7878
}

Tests/WordPressKitTests/WordPressKitTests/Tests/DomainsServiceRemoteRESTTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class DomainsServiceRemoteRESTTests: RemoteTestCase, RESTTestable {
1111

1212
let siteID = 12345
1313

14+
// swiftlint:disable operator_usage_whitespace
1415
let domainServiceAllDomainsMockFilename = "domain-service-all-domain-types.json"
1516
let domainServiceAuthFailureMockFilename = "site-export-auth-failure.json"
1617
let domainServiceBadJsonFailureMockFilename = "domain-service-bad-json.json"
@@ -22,6 +23,7 @@ class DomainsServiceRemoteRESTTests: RemoteTestCase, RESTTestable {
2223
let getDomainContactInformationSuccess = "domain-contact-information-response-success.json"
2324
let domainServiceInvalidQuery = "domain-service-invalid-query.json"
2425
let allDomainsMockFilename = "get-all-domains-response.json"
26+
// swiftlint:enable operator_usage_whitespace
2527

2628
// MARK: - Properties
2729

Tests/WordPressKitTests/WordPressKitTests/Tests/DynamicMockProvider.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ internal extension DynamicMockProvider {
2121
let host = "https://"
2222
let tlds = [".com", ".org", ".blog", ".co.nz", ".co.uk", ".edu", ".gov"]
2323

24-
return host + randomString(length: length) + tlds[Int.random(in: 0 ..< (tlds.count-1))]
24+
return host + randomString(length: length) + tlds[Int.random(in: 0 ..< (tlds.count - 1))]
2525
}
2626

2727
static func randomURLAsString(withLength length: Int, subDirectories: [String]?, file: String?) -> String {
2828
var urlString = randomURLAsString(length: length)
2929

30-
if let subDirectories = subDirectories {
30+
if let subDirectories {
3131
for directory in subDirectories {
3232
urlString += "/\(directory)"
3333
}
3434
}
3535

36-
if let file = file {
36+
if let file {
3737
urlString += "/\(file)"
3838
}
3939

Tests/WordPressKitTests/WordPressKitTests/Tests/IPLocationRemoteTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ final class MockURLProtocol: URLProtocol {
6767
let (response, data) = try handler(request)
6868
client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed)
6969

70-
if let data = data {
70+
if let data {
7171
client?.urlProtocol(self, didLoad: data)
7272
}
7373
client?.urlProtocolDidFinishLoading(self)

Tests/WordPressKitTests/WordPressKitTests/Tests/Models/Stats/V2/Insights/StatsDotComFollowersInsightTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private extension StatsDotComFollowersInsightTests {
9898
func getFollowerDictionary(id: String? = nil, name: String? = nil, subscribedDate: Date? = nil, avatarUrl: String? = nil) -> [String: AnyObject] {
9999
var dateString: String?
100100

101-
if let subscribedDate = subscribedDate {
101+
if let subscribedDate {
102102
let dateFormatter = ISO8601DateFormatter()
103103
dateString = dateFormatter.string(from: subscribedDate)
104104
}

Tests/WordPressKitTests/WordPressKitTests/Tests/NotificationSyncServiceRemoteTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class NotificationSyncServiceRemoteTests: RemoteTestCase, RESTTestable {
88

99
// MARK: - Constants
1010

11+
// swiftlint:disable operator_usage_whitespace
1112
let notificationsEndpoint = "notifications/"
1213
let notificationsReadEndpoint = "notifications/read"
1314
let notificationsSeenEndpoint = "notifications/seen"
@@ -16,6 +17,7 @@ class NotificationSyncServiceRemoteTests: RemoteTestCase, RESTTestable {
1617
let notificationServiceLoadHashMockFilename = "notifications-load-hash.json"
1718
let notificationServiceMarkReadMockFilename = "notifications-mark-as-read.json"
1819
let notificationServiceLastSeenMockFilename = "notifications-last-seen.json"
20+
// swiftlint:enable operator_usage_whitespace
1921

2022
// MARK: - Properties
2123

@@ -41,7 +43,7 @@ class NotificationSyncServiceRemoteTests: RemoteTestCase, RESTTestable {
4143
let expect = expectation(description: "Load all notifications success")
4244
stubRemoteResponse(notificationsEndpoint, filename: notificationServiceLoadAllMockFilename, contentType: .ApplicationJSON)
4345
remote.loadNotes { error, notes in
44-
guard let notes = notes, let note = notes.first else {
46+
guard let notes, let note = notes.first else {
4547
XCTFail()
4648
return
4749
}
@@ -89,7 +91,7 @@ class NotificationSyncServiceRemoteTests: RemoteTestCase, RESTTestable {
8991
let expect = expectation(description: "Load notification hashes success")
9092
stubRemoteResponse(notificationsEndpoint, filename: notificationServiceLoadHashMockFilename, contentType: .ApplicationJSON)
9193
remote.loadHashes { error, notes in
92-
guard let notes = notes else {
94+
guard let notes else {
9395
XCTFail()
9496
return
9597
}

0 commit comments

Comments
 (0)