From 2988cec6079e4de97a31e9b4639703ab2565637d Mon Sep 17 00:00:00 2001 From: Pallab Maiti Date: Wed, 29 Mar 2023 10:48:01 +0530 Subject: [PATCH] comply swiftlint rules --- Podfile.lock | 12 +--- Rudder.xcodeproj/project.pbxproj | 4 -- .../Client/Plugins/RSAnonymousIdPlugin.swift | 1 - .../Client/Plugins/RSContextPlugin.swift | 6 +- .../Plugins/RudderDestinationPlugin.swift | 60 +++++++++---------- 5 files changed, 35 insertions(+), 48 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index ed14263b..ee1e4050 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,9 +1,5 @@ PODS: -<<<<<<< HEAD - - Rudder (2.2.6) -======= - - Rudder (2.2.3) ->>>>>>> dea6b21 (Provided fix for the track event race condition.) + - Rudder (2.2.7) DEPENDENCIES: - Rudder (from `.`) @@ -13,11 +9,7 @@ EXTERNAL SOURCES: :path: "." SPEC CHECKSUMS: -<<<<<<< HEAD - Rudder: 228c479bb2f900cae13fbf469131852201691d67 -======= - Rudder: 5f11c123cefcc5bc915947aefce77675a2ecd6f2 ->>>>>>> dea6b21 (Provided fix for the track event race condition.) + Rudder: 2347c09aee69232812e8262b28d72b69df677940 PODFILE CHECKSUM: ee379229e6a0b60bc98226700ace2de002171547 diff --git a/Rudder.xcodeproj/project.pbxproj b/Rudder.xcodeproj/project.pbxproj index 76a96e81..3bd71b20 100644 --- a/Rudder.xcodeproj/project.pbxproj +++ b/Rudder.xcodeproj/project.pbxproj @@ -110,7 +110,6 @@ ED157C5727D0FFA400F22202 /* RSLifeCycle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RSLifeCycle.swift; sourceTree = ""; }; ED157C5927D1010D00F22202 /* RSPushNotifications.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RSPushNotifications.swift; sourceTree = ""; }; ED277FA027421B06002A8FEA /* RSEventsAndKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RSEventsAndKeys.swift; sourceTree = ""; }; - ED308480288A97C200A357E3 /* main.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; name = main.yml; path = .github/workflows/main.yml; sourceTree = ""; }; ED3D2257279EAC2800EC8366 /* RudderTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RudderTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; ED3D226227A3F0C100EC8366 /* RSClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RSClient.swift; sourceTree = ""; }; ED3D226627A3F0C100EC8366 /* Vendor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Vendor.swift; sourceTree = ""; }; @@ -133,11 +132,9 @@ ED3D228227A3F0C100EC8366 /* RSClient+Plugins.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RSClient+Plugins.swift"; sourceTree = ""; }; ED3D229227A3F0C100EC8366 /* RSMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RSMessage.swift; sourceTree = ""; }; ED3D22BD27A45B6500EC8366 /* RSTypeAlias.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RSTypeAlias.swift; sourceTree = ""; }; - ED488F8627EB141700831594 /* release.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = release.sh; sourceTree = ""; }; ED5603842881C691004B5BEC /* RSUserInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RSUserInfo.swift; sourceTree = ""; }; ED5603862882CE6D004B5BEC /* RSSessionStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RSSessionStorage.swift; sourceTree = ""; }; ED560388288316C2004B5BEC /* Data+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Data+Ext.swift"; sourceTree = ""; }; - ED56038A2887EA73004B5BEC /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = ""; }; ED910CDE273BA25100A3EDFF /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; ED910CE0273BA25100A3EDFF /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = ""; }; ED910CE1273BA25100A3EDFF /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; @@ -353,7 +350,6 @@ EDA7EF462739119600E73142 /* RSConstants.swift */, ED277FA027421B06002A8FEA /* RSEventsAndKeys.swift */, ED3D22BD27A45B6500EC8366 /* RSTypeAlias.swift */, - EDA7EF452739119600E73142 /* RSUserDefaults.swift */, ED05631E291BEB0400BAEE65 /* RSVersion.swift */, ); path = Constants; diff --git a/Sources/Classes/Client/Plugins/RSAnonymousIdPlugin.swift b/Sources/Classes/Client/Plugins/RSAnonymousIdPlugin.swift index 9418699d..5bd909a2 100644 --- a/Sources/Classes/Client/Plugins/RSAnonymousIdPlugin.swift +++ b/Sources/Classes/Client/Plugins/RSAnonymousIdPlugin.swift @@ -32,7 +32,6 @@ import Cocoa import WebKit #endif - class RSAnonymousIdPlugin: RSPlatformPlugin { let type = PluginType.before weak var client: RSClient? diff --git a/Sources/Classes/Client/Plugins/RSContextPlugin.swift b/Sources/Classes/Client/Plugins/RSContextPlugin.swift index 4d3ac13b..3b5222f3 100644 --- a/Sources/Classes/Client/Plugins/RSContextPlugin.swift +++ b/Sources/Classes/Client/Plugins/RSContextPlugin.swift @@ -130,7 +130,7 @@ class RSContextPlugin: RSPlatformPlugin { } func insertDynamicOptionData(message: RSMessage, context: inout [String: Any]) { - /// First priority will given to the `option` passed along with the event + // First priority will given to the `option` passed along with the event if let option = message.option { if let externalIds = option.externalIds { context["externalId"] = externalIds @@ -141,7 +141,7 @@ class RSContextPlugin: RSPlatformPlugin { } } } else { - /// Fetch `customContexts` set using setOption API. + // Fetch `customContexts` set using setOption API. if let globalOption: RSOption = RSSessionStorage.shared.read(.option) { if let customContexts = globalOption.customContexts { for (key, value) in customContexts { @@ -149,7 +149,7 @@ class RSContextPlugin: RSPlatformPlugin { } } } - /// Fetch `externalIds` set using identify API. + // Fetch `externalIds` set using identify API. if let externalIds: [[String: String]] = userDefaults?.read(.externalId) { context["externalId"] = externalIds } diff --git a/Sources/Classes/Client/Plugins/RudderDestinationPlugin.swift b/Sources/Classes/Client/Plugins/RudderDestinationPlugin.swift index e8439401..b7f0441a 100644 --- a/Sources/Classes/Client/Plugins/RudderDestinationPlugin.swift +++ b/Sources/Classes/Client/Plugins/RudderDestinationPlugin.swift @@ -71,36 +71,36 @@ class RudderDestinationPlugin: RSDestinationPlugin { } } -//extension RudderDestinationPlugin { -// internal func configureCloudDestinations(message: T) -> T { -// guard let serverConfig = client?.serverConfig else { return message } -// guard let plugins = client?.controller.plugins[.destination]?.plugins as? [RSDestinationPlugin] else { return message } -// guard let customerValues = message.integrations else { return message } -// -// var merged = [String: Bool]() -// -// for plugin in plugins { -// var hasSettings = false -// if let destinations = serverConfig.destinations { -// if let destination = destinations.first(where: { $0.destinationDefinition?.displayName == plugin.key }), destination.enabled { -// hasSettings = true -// } -// } -// if hasSettings { -// merged[plugin.key] = false -// } -// } -// -// for (key, value) in customerValues { -// merged[key] = value -// } -// -// var modified = message -// modified.integrations = merged -// -// return modified -// } -//} +/*extension RudderDestinationPlugin { + internal func configureCloudDestinations(message: T) -> T { + guard let serverConfig = client?.serverConfig else { return message } + guard let plugins = client?.controller.plugins[.destination]?.plugins as? [RSDestinationPlugin] else { return message } + guard let customerValues = message.integrations else { return message } + + var merged = [String: Bool]() + + for plugin in plugins { + var hasSettings = false + if let destinations = serverConfig.destinations { + if let destination = destinations.first(where: { $0.destinationDefinition?.displayName == plugin.key }), destination.enabled { + hasSettings = true + } + } + if hasSettings { + merged[plugin.key] = false + } + } + + for (key, value) in customerValues { + merged[key] = value + } + + var modified = message + modified.integrations = merged + + return modified + } +}*/ extension RudderDestinationPlugin {