Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Lint Errors #277

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ disabled_rules:
- type_name # tests will have have the format <SUT>_Tests
- xctfail_message
- blanket_disable_command
- non_optional_string_data_conversion
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The places where this rule was being triggered (example here) were places where we were using if let or guard let to safely unwrap these values. There is some debate on reverting and/or changing this rule here so I've opted to disable it for us for now since we are already treating the triggers for this rule safely.


opt_in_rules:
- array_init
Expand Down
14 changes: 7 additions & 7 deletions UnitTests/CardPaymentsTests/CardClient_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ class CardClient_Tests: XCTestCase {
expectation.fulfill()
},
cancel: { _ in XCTFail("Invoked cancel() callback. Should invoke success().") },
threeDSWillLaunch: { _ -> Void in XCTAssert(true) },
threeDSLaunched: { _ -> Void in XCTAssert(true) }
threeDSWillLaunch: { _ in XCTAssert(true) },
threeDSLaunched: { _ in XCTAssert(true) }
)

sut.vaultDelegate = mockCardVaultDelegate
Expand Down Expand Up @@ -291,7 +291,7 @@ class CardClient_Tests: XCTestCase {

let expectation = expectation(description: "approveOrder() completed")

let mockCardDelegate = MockCardDelegate(success: {_, result -> Void in
let mockCardDelegate = MockCardDelegate(success: {_, result in
XCTAssertEqual(result.orderID, "testOrderId")
XCTAssertEqual(result.status, "APPROVED")
XCTAssertFalse(result.didAttemptThreeDSecureAuthentication)
Expand All @@ -313,7 +313,7 @@ class CardClient_Tests: XCTestCase {

let expectation = expectation(description: "approveOrder() completed")

let mockCardDelegate = MockCardDelegate(success: {_, _ -> Void in
let mockCardDelegate = MockCardDelegate(success: {_, _ in
XCTFail("Invoked success() callback. Should invoke error().")
}, error: { _, error in
XCTAssertEqual(error.domain, "sdk-domain")
Expand All @@ -339,7 +339,7 @@ class CardClient_Tests: XCTestCase {

let expectation = expectation(description: "approveOrder() completed")

let mockCardDelegate = MockCardDelegate(success: {_, _ -> Void in
let mockCardDelegate = MockCardDelegate(success: {_, _ in
XCTFail("Invoked success() callback. Should invoke error().")
}, error: { _, error in
XCTAssertEqual(error.domain, CardClientError.domain)
Expand Down Expand Up @@ -375,8 +375,8 @@ class CardClient_Tests: XCTestCase {
expectation.fulfill()
},
cancel: { _ in XCTFail("Invoked cancel() callback. Should invoke success().") },
threeDSWillLaunch: { _ -> Void in XCTAssert(true) },
threeDSLaunched: { _ -> Void in XCTAssert(true) })
threeDSWillLaunch: { _ in XCTAssert(true) },
threeDSLaunched: { _ in XCTAssert(true) })

sut.delegate = mockCardDelegate
sut.approveOrder(request: cardRequest)
Expand Down
Loading