From 2deb66399918e484eda8fbba48090ee243e7e5d6 Mon Sep 17 00:00:00 2001 From: Gustavo Meyer <107439697+grmeyer-hw-dev@users.noreply.github.com> Date: Wed, 29 Mar 2023 16:20:25 -0700 Subject: [PATCH] DTSERWONE-821 Address swift lint v0.50 violations (#138) * DTSERWONE-821 Address swiftling v0.50 violations --- .github/workflows/ci.yml | 2 +- Cartfile.resolved | 2 +- HyperwalletSDK.podspec | 2 +- HyperwalletSDK.xcodeproj/project.pbxproj | 22 ------------------- ...perwalletAuthenticationTokenProvider.swift | 3 ++- Tests/AnyCodableTests.swift | 1 + ...lletTransferMethodConfigurationTests.swift | 4 ++-- ...ansferMethodUpdateConfigurationTests.swift | 3 ++- ...rationFeeAndProcessingTimeQueryTests.swift | 1 + ...rMethodConfigurationFieldResultTests.swift | 1 + ...ferMethodConfigurationKeyResultTests.swift | 1 + Tests/HTTPTransactionTests.swift | 1 - Tests/Receipt/HyperwalletReceiptTests.swift | 3 ++- Tests/TransactionTypeTests.swift | 1 + .../HyperwalletPrepaidCardTests.swift | 1 - .../HyperwalletTransferMethodTests.swift | 1 + Tests/User/HyperwalletUserTests.swift | 1 - fastlane/Fastfile | 2 +- 18 files changed, 18 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 406b8a88..e731c9b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: matrix: include: - os: macos-12 - xcode_version: 13.4 + xcode_version: 14.2 fastlane_task: unit_tests runs-on: ${{ matrix.os }} diff --git a/Cartfile.resolved b/Cartfile.resolved index 1adda072..3ed53cb2 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "JanGorman/Hippolyte" "0.6.0" +github "JanGorman/Hippolyte" "1.4.1" diff --git a/HyperwalletSDK.podspec b/HyperwalletSDK.podspec index 2b63babc..18814d05 100644 --- a/HyperwalletSDK.podspec +++ b/HyperwalletSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'HyperwalletSDK' - spec.version = '1.0.0-beta17' + spec.version = '1.0.0-beta18' spec.summary = 'Hyperwallet Core SDK for iOS to integrate with Hyperwallet Platform' spec.homepage = 'https://github.com/hyperwallet/hyperwallet-ios-sdk' spec.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/HyperwalletSDK.xcodeproj/project.pbxproj b/HyperwalletSDK.xcodeproj/project.pbxproj index de8414dd..7a1bf300 100644 --- a/HyperwalletSDK.xcodeproj/project.pbxproj +++ b/HyperwalletSDK.xcodeproj/project.pbxproj @@ -728,7 +728,6 @@ 98101DB62238A2F000BA04CA /* Sources */, 98101DB72238A2F000BA04CA /* Frameworks */, 98101DB82238A2F000BA04CA /* Resources */, - DBCA37C3225E52DA00CD4137 /* Swiftlint */, ); buildRules = ( ); @@ -878,27 +877,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - DBCA37C3225E52DA00CD4137 /* Swiftlint */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = Swiftlint; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "set -e\nset -x\n\nif ! which swiftlint > /dev/null; then\necho \"warning: SwiftLint is not installed. To install run `brew install SwiftLint`\"\nelse\n swiftlint --fix\n swiftlint\nfi\n"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 98101DB62238A2F000BA04CA /* Sources */ = { isa = PBXSourcesBuildPhase; diff --git a/Sources/HyperwalletAuthenticationTokenProvider.swift b/Sources/HyperwalletAuthenticationTokenProvider.swift index f2d15871..dbafbec2 100644 --- a/Sources/HyperwalletAuthenticationTokenProvider.swift +++ b/Sources/HyperwalletAuthenticationTokenProvider.swift @@ -23,7 +23,8 @@ import Foundation /// to authenticate the User to the Hyperwallet platform. /// /// Implementations of `HyperwalletAuthenticationTokenProvider` are expected to be non-blocking and thread safe. -@objc public protocol HyperwalletAuthenticationTokenProvider { +@objc +public protocol HyperwalletAuthenticationTokenProvider { /// A callback interface to handle the submission of an authentication token or an error message in case of failure. /// /// The authentication token is a JSON web token that contains as part of its claim set the principal that will diff --git a/Tests/AnyCodableTests.swift b/Tests/AnyCodableTests.swift index fff41563..717956d1 100644 --- a/Tests/AnyCodableTests.swift +++ b/Tests/AnyCodableTests.swift @@ -83,3 +83,4 @@ class AnyCodableTests: XCTestCase { XCTAssertNotNil(result[4].value as! String, "") // null } } +// swiftlint:enable force_cast force_try diff --git a/Tests/GraphQL/HyperwalletTransferMethodConfigurationTests.swift b/Tests/GraphQL/HyperwalletTransferMethodConfigurationTests.swift index bbda2405..49465838 100644 --- a/Tests/GraphQL/HyperwalletTransferMethodConfigurationTests.swift +++ b/Tests/GraphQL/HyperwalletTransferMethodConfigurationTests.swift @@ -2,7 +2,7 @@ import Hippolyte @testable import HyperwalletSDK import XCTest -// swiftlint:disable multiline_arguments +// swiftlint:disable multiline_arguments function_body_length class HyperwalletTransferMethodConfigurationTests: XCTestCase { override func setUp() { Hyperwallet.setup(HyperwalletTestHelper.authenticationProvider) @@ -14,7 +14,6 @@ class HyperwalletTransferMethodConfigurationTests: XCTestCase { } } - // swiftlint:disable function_body_length func testRetrieveTransferMethodConfigurationKeys_success() { // Given let request = setUpTransferMethodConfigurationRequest("TransferMethodConfigurationKeysResponse") @@ -219,3 +218,4 @@ class HyperwalletTransferMethodConfigurationTests: XCTestCase { error: error)) } } +// swiftlint:enable multiline_arguments function_body_length diff --git a/Tests/GraphQL/HyperwalletTransferMethodUpdateConfigurationTests.swift b/Tests/GraphQL/HyperwalletTransferMethodUpdateConfigurationTests.swift index 87e1fcc3..0f7db3c0 100644 --- a/Tests/GraphQL/HyperwalletTransferMethodUpdateConfigurationTests.swift +++ b/Tests/GraphQL/HyperwalletTransferMethodUpdateConfigurationTests.swift @@ -20,6 +20,7 @@ import Hippolyte @testable import HyperwalletSDK import XCTest +// swiftlint:disable function_body_length class HyperwalletTransferMethodUpdateConfigurationTests: XCTestCase { override func setUp() { Hyperwallet.setup(HyperwalletTestHelper.authenticationProvider) @@ -31,7 +32,6 @@ class HyperwalletTransferMethodUpdateConfigurationTests: XCTestCase { } } - // swiftlint:disable function_body_length func testRetrieveTransferMethodUpdateConfigurationFields_bankAccount() { // Given let request = setUpTransferMethodUpdateConfigurationRequest("TransferMethodUpdateConfigurationFieldsResponse") @@ -279,3 +279,4 @@ class HyperwalletTransferMethodUpdateConfigurationTests: XCTestCase { error: error)) } } +// swiftlint:enable function_body_length diff --git a/Tests/GraphQL/Query/HyperwalletTransferMethodConfigurationFeeAndProcessingTimeQueryTests.swift b/Tests/GraphQL/Query/HyperwalletTransferMethodConfigurationFeeAndProcessingTimeQueryTests.swift index 8c10c9af..501aca02 100644 --- a/Tests/GraphQL/Query/HyperwalletTransferMethodConfigurationFeeAndProcessingTimeQueryTests.swift +++ b/Tests/GraphQL/Query/HyperwalletTransferMethodConfigurationFeeAndProcessingTimeQueryTests.swift @@ -34,3 +34,4 @@ class HyperwalletTransferMethodConfigurationFeeAndProcessingTimeQueryTests: XCTe XCTAssertNotEqual(usUsdFieldQuery.hashValue, usCadQuery.hashValue) } } +// swiftlint:enable type_name diff --git a/Tests/GraphQL/TransferMethodConfigurationFieldResultTests.swift b/Tests/GraphQL/TransferMethodConfigurationFieldResultTests.swift index 6a1885c2..a6b30282 100644 --- a/Tests/GraphQL/TransferMethodConfigurationFieldResultTests.swift +++ b/Tests/GraphQL/TransferMethodConfigurationFieldResultTests.swift @@ -103,3 +103,4 @@ class TransferMethodConfigurationFieldResultTests: XCTestCase { return graphQlResult.data } } +// swiftlint:enable force_try diff --git a/Tests/GraphQL/TransferMethodConfigurationKeyResultTests.swift b/Tests/GraphQL/TransferMethodConfigurationKeyResultTests.swift index 0986f1c2..56e48d65 100644 --- a/Tests/GraphQL/TransferMethodConfigurationKeyResultTests.swift +++ b/Tests/GraphQL/TransferMethodConfigurationKeyResultTests.swift @@ -86,3 +86,4 @@ class TransferMethodConfigurationKeyResultTests: XCTestCase { return graphQlResult.data } } +// swiftlint:enable force_try diff --git a/Tests/HTTPTransactionTests.swift b/Tests/HTTPTransactionTests.swift index 07be2320..4b7ec855 100644 --- a/Tests/HTTPTransactionTests.swift +++ b/Tests/HTTPTransactionTests.swift @@ -61,7 +61,6 @@ class HTTPTransactionTests: XCTestCase { XCTAssertNotNil(configuration.authorization, "The authorization has not been initialized") } - // swiftlint:disable function_body_length func testPerformRest_successURLRequest() { // Given let queryParam = HyperwalletBankAccountQueryParam() diff --git a/Tests/Receipt/HyperwalletReceiptTests.swift b/Tests/Receipt/HyperwalletReceiptTests.swift index 3391fe03..a65205a0 100644 --- a/Tests/Receipt/HyperwalletReceiptTests.swift +++ b/Tests/Receipt/HyperwalletReceiptTests.swift @@ -2,6 +2,7 @@ import Hippolyte @testable import HyperwalletSDK import XCTest +// swiftlint:disable function_body_length class HyperwalletReceiptTests: XCTestCase { override func setUp() { Hyperwallet.setup(HyperwalletTestHelper.authenticationProvider) @@ -13,7 +14,6 @@ class HyperwalletReceiptTests: XCTestCase { } } - // swiftlint:disable function_body_length func testListUserReceipts_success() { // Given let expectation = self.expectation(description: "List User Receipts completed") @@ -153,3 +153,4 @@ class HyperwalletReceiptTests: XCTestCase { } } } +// swiftlint:enable function_body_length diff --git a/Tests/TransactionTypeTests.swift b/Tests/TransactionTypeTests.swift index eb75b279..ed2e3fcd 100644 --- a/Tests/TransactionTypeTests.swift +++ b/Tests/TransactionTypeTests.swift @@ -81,6 +81,7 @@ class TransactionTypeTests: XCTestCase { "INVALID_URL") } } + // swiftlint:enable force_cast private func assertCreateRestRequestSucceeded(transactionType: TransactionType, httpMethod: HTTPMethod, diff --git a/Tests/TransferMethod/HyperwalletPrepaidCardTests.swift b/Tests/TransferMethod/HyperwalletPrepaidCardTests.swift index bd371ab3..a7c28b80 100644 --- a/Tests/TransferMethod/HyperwalletPrepaidCardTests.swift +++ b/Tests/TransferMethod/HyperwalletPrepaidCardTests.swift @@ -40,7 +40,6 @@ class HyperwalletPrepaidCardTests: XCTestCase { XCTAssertEqual(prepaidCardResponse?.type, HyperwalletTransferMethod.TransferMethodType.prepaidCard.rawValue) } - // swiftlint:disable function_body_length func testListPrepaidCards_success() { // Given let expectation = self.expectation(description: "List prepaid cards completed") diff --git a/Tests/TransferMethod/HyperwalletTransferMethodTests.swift b/Tests/TransferMethod/HyperwalletTransferMethodTests.swift index 43d19ebb..7d851240 100644 --- a/Tests/TransferMethod/HyperwalletTransferMethodTests.swift +++ b/Tests/TransferMethod/HyperwalletTransferMethodTests.swift @@ -121,3 +121,4 @@ class HyperwalletTransferMethodTests: XCTestCase { XCTAssertNil(transferMethods, "The `transferMethods` should be nil") } } +// swiftlint:enable function_body_length diff --git a/Tests/User/HyperwalletUserTests.swift b/Tests/User/HyperwalletUserTests.swift index be5f7868..f8ab5b8c 100644 --- a/Tests/User/HyperwalletUserTests.swift +++ b/Tests/User/HyperwalletUserTests.swift @@ -13,7 +13,6 @@ class HyperwalletUserTests: XCTestCase { } } - // swiftlint:disable function_body_length func testGetUser_individualSuccess() { // Given let expectation = self.expectation(description: "Get HyperwalletUser completed") diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 7ea978fc..627960a6 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -16,7 +16,7 @@ end lane :unit_tests do run_tests( project: "HyperwalletSDK.xcodeproj", - devices: ['iPhone 13 Pro'], + devices: ['iPhone 14 Pro'], derived_data_path: './output', scheme: "HyperwalletSDK", configuration: 'Debug',