Skip to content

Commit 23b5802

Browse files
committed
Fix swiftlint errors
1 parent a93c8ed commit 23b5802

File tree

44 files changed

+85
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+85
-67
lines changed

Modules/Sources/WordPressKit/AccountServiceRemoteREST+SocialService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extension AccountServiceRemoteREST {
3333
"id_token": token
3434
] as [String: AnyObject]
3535

36-
if let connectParameters = connectParameters {
36+
if let connectParameters {
3737
params.merge(connectParameters, uniquingKeysWith: { (current, _) in current })
3838
}
3939

Modules/Sources/WordPressKit/ActivityServiceRemote.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ open class ActivityServiceRemote: ServiceRemoteWordPressComREST {
5151
path?.queryItems?.append(URLQueryItem(name: "number", value: "\(count)"))
5252
path?.queryItems?.append(URLQueryItem(name: "page", value: "\(pageNumber)"))
5353

54-
if let after = after, let before = before,
54+
if let after, let before,
5555
let lastSecondOfBeforeDay = before.endOfDay() {
5656
path?.queryItems?.append(URLQueryItem(name: "after", value: formatter.string(from: after)))
5757
path?.queryItems?.append(URLQueryItem(name: "before", value: formatter.string(from: lastSecondOfBeforeDay)))
@@ -106,7 +106,7 @@ open class ActivityServiceRemote: ServiceRemoteWordPressComREST {
106106
let path = self.path(forEndpoint: endpoint, withVersion: ._2_0)
107107
var parameters: [String: AnyObject] = [:]
108108

109-
if let after = after, let before = before,
109+
if let after, let before,
110110
let lastSecondOfBeforeDay = before.endOfDay() {
111111
parameters["after"] = formatter.string(from: after) as AnyObject
112112
parameters["before"] = formatter.string(from: lastSecondOfBeforeDay) as AnyObject

Modules/Sources/WordPressKit/ActivityServiceRemote_ApiVersion1_0.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import WordPressKitObjC
2727
let path = self.path(forEndpoint: endpoint, withVersion: ._1_0)
2828
var parameters: [String: AnyObject] = [:]
2929

30-
if let types = types {
30+
if let types {
3131
parameters["types"] = types.toDictionary() as AnyObject
3232
}
3333

Modules/Sources/WordPressKit/AppTransportSecuritySettings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct AppTransportSecuritySettings {
4949
return !allowsInsecureHTTPLoads
5050
}
5151

52-
guard let settings = settings else {
52+
guard let settings else {
5353
return true
5454
}
5555

Modules/Sources/WordPressKit/BlogJetpackSettingsServiceRemote.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public extension BlogJetpackSettingsServiceRemote {
235235

236236
// RemoteBlogJetpackSettings keys
237237
public static let monitorEnabled = "monitor"
238-
public static let blockMaliciousLoginAttempts = "protect"
238+
public static let blockMaliciousLoginAttempts = "protect"
239239
public static let allowListedIPAddresses = "jetpack_protect_global_whitelist"
240240
public static let allowListedIPsLocal = "local"
241241
public static let ssoEnabled = "sso"
@@ -247,7 +247,7 @@ public extension BlogJetpackSettingsServiceRemote {
247247
static let monitorPushNotifications = "wp_note_notifications"
248248

249249
// RemoteBlogJetpackModuleSettings keys
250-
public static let serveImagesFromOurServers = "photon"
250+
public static let serveImagesFromOurServers = "photon"
251251

252252
}
253253

Modules/Sources/WordPressKit/BloggingPromptsServiceRemote.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ open class BloggingPromptsServiceRemote: ServiceRemoteWordPressComREST {
3333
let requestParameter: [String: AnyHashable] = {
3434
var params = [String: AnyHashable]()
3535

36-
if let number = number, number > 0 {
36+
if let number, number > 0 {
3737
params["number"] = number
3838
}
3939

40-
if let fromDate = fromDate {
40+
if let fromDate {
4141
// convert to yyyy-MM-dd format, excluding the timezone information.
4242
// the date parameter doesn't need to be timezone-accurate since prompts are grouped by date.
4343
params["from"] = Self.dateFormatter.string(from: fromDate)

Modules/Sources/WordPressKit/DashboardServiceRemote.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ open class DashboardServiceRemote: ServiceRemoteWordPressComREST {
99
success: @escaping (NSDictionary) -> Void,
1010
failure: @escaping (Error) -> Void
1111
) {
12-
let requestUrl = self.path(forEndpoint: "sites/\(blogID)/dashboard/cards-data/", withVersion: ._2_0)
12+
let requestUrl = self.path(forEndpoint: "sites/\(blogID)/dashboard/cards-data/", withVersion: ._2_0)
1313
var params: [String: AnyObject]?
1414

1515
do {

Modules/Sources/WordPressKit/DomainContactInformation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public struct ValidateDomainContactInformationResponse: Codable {
2121
/// Returns true if any of the properties within `messages` has a value.
2222
///
2323
public var hasMessages: Bool {
24-
if let messages = messages {
24+
if let messages {
2525
let mirror = Mirror(reflecting: messages)
2626

2727
for child in mirror.children {

Modules/Sources/WordPressKit/FeatureFlagRemote.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ open class FeatureFlagRemote: ServiceRemoteWordPressComREST {
4949
WPKitLogError("Error retrieving remote feature flags")
5050
WPKitLogError("\(error)")
5151

52-
if let response = response {
52+
if let response {
5353
WPKitLogDebug("Response Code: \(response.statusCode)")
5454
}
5555

Modules/Sources/WordPressKit/GravatarServiceRemote.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ open class GravatarServiceRemote {
3939

4040
let session = URLSession.shared
4141
let task = session.dataTask(with: targetURL) { (data: Data?, _: URLResponse?, error: Error?) in
42-
guard error == nil, let data = data else {
42+
guard error == nil, let data else {
4343
failure(error)
4444
return
4545
}
@@ -147,11 +147,13 @@ open class GravatarServiceRemote {
147147

148148
// MARK: - Private Structs
149149
private struct UploadParameters {
150+
// swiftlint:disable operator_usage_whitespace
150151
static let endpointURL = "https://api.gravatar.com/v1/upload-image"
151152
static let HTTPMethod = "POST"
152153
static let contentType = "application/octet-stream"
153154
static let filename = "profile.png"
154155
static let imageKey = "filedata"
155156
static let accountKey = "account"
157+
// swiftlint:enable operator_usage_whitespace
156158
}
157159
}

0 commit comments

Comments
 (0)