diff --git a/iOS_SDK/OneSignalSDK/OneSignalCoreMocks/.swiftlint.yml b/iOS_SDK/OneSignalSDK/OneSignalCoreMocks/.swiftlint.yml new file mode 100644 index 000000000..9d2d81d60 --- /dev/null +++ b/iOS_SDK/OneSignalSDK/OneSignalCoreMocks/.swiftlint.yml @@ -0,0 +1,4 @@ +# in tests, we may want to force cast and throw any errors +disabled_rules: + - force_cast + - identifier_name diff --git a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSIdentityModel.swift b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSIdentityModel.swift index 194e6f16f..6e70b5057 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSIdentityModel.swift +++ b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSIdentityModel.swift @@ -86,7 +86,7 @@ class OSIdentityModel: OSModel { } self.set(property: "aliases", newValue: aliases) } - + /** Called to clear the model's data in preparation for hydration via a fetch user call. */ diff --git a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSRequestCreateUser.swift b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSRequestCreateUser.swift index b356bcd49..dbf8ed914 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSRequestCreateUser.swift +++ b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSRequestCreateUser.swift @@ -48,7 +48,7 @@ class OSRequestCreateUser: OneSignalRequest, OSUserRequest { OneSignalLog.onesignalLog(.LL_DEBUG, message: "Cannot generate the create user request due to null app ID.") return false } - let _ = self.addPushSubscriptionIdToAdditionalHeaders() + _ = self.addPushSubscriptionIdToAdditionalHeaders() self.addJWTHeader(identityModel: identityModel) self.path = "apps/\(appId)/users" // The pushSub doesn't need to have a token. diff --git a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSRequestUpdateProperties.swift b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSRequestUpdateProperties.swift index dc91e6d9d..91290cead 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSRequestUpdateProperties.swift +++ b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSRequestUpdateProperties.swift @@ -41,7 +41,7 @@ class OSRequestUpdateProperties: OneSignalRequest, OSUserRequest { func prepareForExecution() -> Bool { if let onesignalId = identityModel.onesignalId, let appId = OneSignalConfigManager.getAppId() { - let _ = self.addPushSubscriptionIdToAdditionalHeaders() + _ = self.addPushSubscriptionIdToAdditionalHeaders() self.addJWTHeader(identityModel: identityModel) self.path = "apps/\(appId)/users/by/\(OS_ONESIGNAL_ID)/\(onesignalId)" return true diff --git a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSUserRequest.swift b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSUserRequest.swift index 43057203e..f6020c140 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSUserRequest.swift +++ b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/Requests/OSUserRequest.swift @@ -41,7 +41,7 @@ internal extension OneSignalRequest { // additionalHeaders["Authorization"] = "Bearer \(token)" // self.additionalHeaders = additionalHeaders } - + /** Returns if the `OneSignal-Subscription-Id` header was added successfully. */ func addPushSubscriptionIdToAdditionalHeaders() -> Bool { if let pushSubscriptionId = OneSignalUserManagerImpl.sharedInstance.pushSubscriptionId { diff --git a/iOS_SDK/OneSignalSDK/OneSignalUserMocks/.swiftlint.yml b/iOS_SDK/OneSignalSDK/OneSignalUserMocks/.swiftlint.yml new file mode 100644 index 000000000..9cbe9dd8f --- /dev/null +++ b/iOS_SDK/OneSignalSDK/OneSignalUserMocks/.swiftlint.yml @@ -0,0 +1,2 @@ +disabled_rules: + - identifier_name