diff --git a/.swiftformat b/.swiftformat index 2ab9f74..f5b95dd 100644 --- a/.swiftformat +++ b/.swiftformat @@ -35,6 +35,7 @@ --enable semicolons --semicolons never --disable sortedImports +--disable sortImports --importgrouping testable-bottom --enable spaceAroundOperators --operatorfunc spaced diff --git a/.swiftlint.yml b/.swiftlint.yml index 29287ee..ea4ccda 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -16,6 +16,7 @@ opt_in_rules: disabled_rules: - opening_brace + - non_optional_string_data_conversion # configurable rules can be customized from this configuration file closing_brace: error diff --git a/Sources/Clickstream/AWSClickstreamPlugin+ClientBehavior.swift b/Sources/Clickstream/AWSClickstreamPlugin+ClientBehavior.swift index 0288957..7f98b1b 100644 --- a/Sources/Clickstream/AWSClickstreamPlugin+ClientBehavior.swift +++ b/Sources/Clickstream/AWSClickstreamPlugin+ClientBehavior.swift @@ -69,7 +69,7 @@ extension AWSClickstreamPlugin { } func registerGlobalProperties(_ properties: AnalyticsProperties) { - properties.forEach { key, value in + for (key, value) in properties { analyticsClient.addGlobalAttribute(value, forKey: key) } } diff --git a/Tests/ClickstreamTests/Clickstream/ClickstreamEventTest.swift b/Tests/ClickstreamTests/Clickstream/ClickstreamEventTest.swift index dbb8c73..71f40fb 100644 --- a/Tests/ClickstreamTests/Clickstream/ClickstreamEventTest.swift +++ b/Tests/ClickstreamTests/Clickstream/ClickstreamEventTest.swift @@ -8,6 +8,7 @@ @testable import Clickstream import Foundation import XCTest + class ClickstreamEventTest: XCTestCase { let testAppId = "testAppId" let storage = ClickstreamContextStorage(userDefaults: UserDefaults.standard) diff --git a/Tests/ClickstreamTests/Clickstream/EventRecorderTest.swift b/Tests/ClickstreamTests/Clickstream/EventRecorderTest.swift index d4fe57c..e914dc9 100644 --- a/Tests/ClickstreamTests/Clickstream/EventRecorderTest.swift +++ b/Tests/ClickstreamTests/Clickstream/EventRecorderTest.swift @@ -182,7 +182,7 @@ class EventRecorderTest: XCTestCase { XCTAssertEqual(85.5, (userAttributes["score"] as! JsonObject)["value"] as! Double) XCTAssertEqual("carl", (userAttributes["_user_name"] as! JsonObject)["value"] as! String) } - + func testModifyGlobalUserAttributesWillNotAffectTheEventUserAttributes() throws { var userInfo = JsonObject() let currentTimeStamp = Date().millisecondsSince1970