Skip to content

Commit 7374c34

Browse files
authored
Fix swiftlint warnings (#68)
1 parent 02dc358 commit 7374c34

File tree

5 files changed

+2
-9
lines changed

5 files changed

+2
-9
lines changed

Development/UID2SDKDevelopmentApp/UID2SDKDevelopmentApp/Networking/AppUID2Client.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,12 @@ internal final class AppUID2Client: Sendable {
173173
func decryptResponse(_ b64Secret: String, _ responseData: Data, _ isRefresh: Bool = false) -> Data? {
174174

175175
// Confirm that responseData is Base64
176-
// swiftlint:disable:next non_optional_string_data_conversion
177176
guard let base64String = String(data: responseData, encoding: .utf8),
178177
let decodedData = Data(base64Encoded: base64String, options: .ignoreUnknownCharacters) else {
179178
return responseData
180179
}
181180

182-
// Parse Reponse Envelope
181+
// Parse Response Envelope
183182
// https://github.com/UnifiedID2/uid2docs/blob/main/api/v2/encryption-decryption.md#encrypted-response-envelope
184183

185184
// Decrypt Data
@@ -212,7 +211,6 @@ internal final class AppUID2Client: Sendable {
212211
payload = decryptedData.subdata(in: 16..<decryptedData.count)
213212
}
214213

215-
// swiftlint:disable:next non_optional_string_data_conversion
216214
guard let _ = String(data: payload, encoding: .utf8) else {
217215
return nil
218216
}

Development/UID2SDKDevelopmentApp/UID2SDKDevelopmentApp/RootView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ extension TokenGenerationError: LocalizedError {
8585
if let message,
8686
let jsonObject = try? JSONSerialization.jsonObject(with: Data(message.utf8)),
8787
let jsonString = try? JSONSerialization.data(withJSONObject: jsonObject, options: .prettyPrinted) {
88-
// swiftlint:disable:next non_optional_string_data_conversion
8988
formattedMessage = String(data: jsonString, encoding: .utf8)
9089
} else {
9190
formattedMessage = message

Sources/UID2/Networking/DataEnvelope.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ internal enum DataEnvelope {
4545
extension Data {
4646
/// A convenience initializer for converting from a Data representation of a base64 encoded string to its decoded Data.
4747
init?(base64EncodedData: Data, options: Data.Base64DecodingOptions = []) {
48-
// https://github.com/realm/SwiftLint/issues/5263#issuecomment-2115182747
49-
// swiftlint:disable:next non_optional_string_data_conversion
5048
guard let base64String = String(data: base64EncodedData, encoding: .utf8) else {
5149
return nil
5250
}

Sources/UID2/UID2Client.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ internal final class UID2Client: Sendable {
121121
let decoder = JSONDecoder.apiDecoder()
122122
guard response.statusCode == 200 else {
123123
let statusCode = response.statusCode
124-
// https://github.com/realm/SwiftLint/issues/5263#issuecomment-2115182747
125-
// swiftlint:disable:next non_optional_string_data_conversion
126124
let responseText = String(data: data, encoding: .utf8) ?? "<none>"
127125
os_log("Request failure (%d) %@", log: log, type: .error, statusCode, responseText)
128126
if !environment.isProduction {

Sources/UID2/UID2Manager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import Combine
99
import Foundation
1010
import OSLog
1111

12-
// swiftlint:disable:next type_body_length
1312
@available(iOS 13, tvOS 13, *)
13+
// swiftlint:disable:next type_body_length
1414
public final actor UID2Manager {
1515
private enum InitializationState {
1616
case pending

0 commit comments

Comments
 (0)