From 7272b9276513aa653f581f5587db410bf9d294fc Mon Sep 17 00:00:00 2001 From: Francisco Gindre Date: Tue, 12 Dec 2023 15:46:15 -0300 Subject: [PATCH] [#1332] Enable Swiftlint workflow Closes #1332. This runs an ubuntu box with a swiftlint process and nothing else. During implementing this same thing in the ZIP-321 library I found that the Swift Package Plugin for Swiftlint did work after some juggling, but it added a lot of build time to the main build job so it delayed the CI for several minutes while a separate machine would to the same chore more effectively and also in an isolated way without mixing lint and build failures --- .github/workflows/swiftlint.yml | 17 +++++++++++++++++ .../Checkpoint/BundleCheckpointSource.swift | 2 +- .../Modules/Service/LightWalletService.swift | 4 ---- .../Rust/ZcashKeyDerivationBackend.swift | 4 ---- 4 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/swiftlint.yml diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 000000000..c0608af31 --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,17 @@ +name: SwiftLint + +on: + pull_request: + paths: + - '.github/workflows/swiftlint.yml' + - '.swiftlint.yml' + - '**/*.swift' + +jobs: + SwiftLint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: GitHub Action for SwiftLint + uses: norio-nomura/action-swiftlint@3.2.1 + \ No newline at end of file diff --git a/Sources/ZcashLightClientKit/Checkpoint/BundleCheckpointSource.swift b/Sources/ZcashLightClientKit/Checkpoint/BundleCheckpointSource.swift index 92eaa5018..ce70d3c1e 100644 --- a/Sources/ZcashLightClientKit/Checkpoint/BundleCheckpointSource.swift +++ b/Sources/ZcashLightClientKit/Checkpoint/BundleCheckpointSource.swift @@ -31,7 +31,7 @@ struct BundleCheckpointSource: CheckpointSource { func birthday(for height: BlockHeight) -> Checkpoint { Checkpoint.birthday( - with: height, + with: height, checkpointDirectory: BundleCheckpointURLProvider.default.url(self.network) ) ?? saplingActivation } diff --git a/Sources/ZcashLightClientKit/Modules/Service/LightWalletService.swift b/Sources/ZcashLightClientKit/Modules/Service/LightWalletService.swift index 2bbf307c7..b6f3cf60b 100644 --- a/Sources/ZcashLightClientKit/Modules/Service/LightWalletService.swift +++ b/Sources/ZcashLightClientKit/Modules/Service/LightWalletService.swift @@ -137,10 +137,6 @@ protocol LightWalletServiceResponse { struct LightWalletServiceFactory { let endpoint: LightWalletEndpoint - init(endpoint: LightWalletEndpoint) { - self.endpoint = endpoint - } - func make() -> LightWalletService { return LightWalletGRPCService(endpoint: endpoint) } diff --git a/Sources/ZcashLightClientKit/Rust/ZcashKeyDerivationBackend.swift b/Sources/ZcashLightClientKit/Rust/ZcashKeyDerivationBackend.swift index ade6a2714..fb7ed96e6 100644 --- a/Sources/ZcashLightClientKit/Rust/ZcashKeyDerivationBackend.swift +++ b/Sources/ZcashLightClientKit/Rust/ZcashKeyDerivationBackend.swift @@ -11,10 +11,6 @@ import libzcashlc struct ZcashKeyDerivationBackend: ZcashKeyDerivationBackendWelding { let networkType: NetworkType - init(networkType: NetworkType) { - self.networkType = networkType - } - // MARK: Address metadata and validation static func getAddressMetadata(_ address: String) -> AddressMetadata? { var networkId: UInt32 = 0