From bf3bb8d168cb573edd5254fa524448fb8a1722b1 Mon Sep 17 00:00:00 2001 From: Danny Moesch Date: Tue, 10 Nov 2020 22:43:44 +0100 Subject: [PATCH] Use SwiftLint version 0.47.x --- .swiftlint.yml | 5 +++-- passKitTests/Crypto/CryptoFrameworkTest.swift | 2 +- passKitTests/Crypto/PGPAgentTest.swift | 2 +- passTests/Models/QRKeyScannerTest.swift | 10 +++++----- scripts/swiftlint.sh | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index dcf3b8f..e0624ba 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -9,7 +9,7 @@ excluded: ## Active rules -whitelist_rules: +only_rules: - anyobject_protocol - array_init - attributes @@ -81,6 +81,7 @@ whitelist_rules: - implicit_getter - implicit_return # - implicitly_unwrapped_optional + - inclusive_language # - indentation_width - inert_defer - is_disjoint @@ -168,6 +169,7 @@ whitelist_rules: - switch_case_alignment - switch_case_on_newline - syntactic_sugar + - test_case_accessibility - todo - toggle_bool - trailing_closure @@ -180,7 +182,6 @@ whitelist_rules: - type_name - unavailable_function - unneeded_break_in_switch - - unneeded_notification_center_removal - unneeded_parentheses_in_closure_argument # - unowned_variable_capture - untyped_error_in_catch diff --git a/passKitTests/Crypto/CryptoFrameworkTest.swift b/passKitTests/Crypto/CryptoFrameworkTest.swift index 91374ce..a12d6af 100644 --- a/passKitTests/Crypto/CryptoFrameworkTest.swift +++ b/passKitTests/Crypto/CryptoFrameworkTest.swift @@ -13,7 +13,7 @@ import XCTest @testable import Crypto class CryptoFrameworkTest: XCTestCase { - typealias MessageConverter = (CryptoPGPMessage, NSErrorPointer) -> CryptoPGPMessage? + private typealias MessageConverter = (CryptoPGPMessage, NSErrorPointer) -> CryptoPGPMessage? private let testText = "Hello World!" diff --git a/passKitTests/Crypto/PGPAgentTest.swift b/passKitTests/Crypto/PGPAgentTest.swift index 0777a80..3846b4c 100644 --- a/passKitTests/Crypto/PGPAgentTest.swift +++ b/passKitTests/Crypto/PGPAgentTest.swift @@ -31,7 +31,7 @@ class PGPAgentTest: XCTestCase { super.tearDown() } - func basicEncryptDecrypt(using pgpAgent: PGPAgent, keyID: String, encryptKeyID: String? = nil, requestPassphrase: @escaping (String) -> String = requestPGPKeyPassphrase, encryptInArmored: Bool = true, decryptFromArmored: Bool = true) throws -> Data? { + private func basicEncryptDecrypt(using pgpAgent: PGPAgent, keyID: String, encryptKeyID: String? = nil, requestPassphrase: @escaping (String) -> String = requestPGPKeyPassphrase, encryptInArmored: Bool = true, decryptFromArmored: Bool = true) throws -> Data? { passKit.Defaults.encryptInArmored = encryptInArmored let encryptedData = try pgpAgent.encrypt(plainData: testData, keyID: keyID) passKit.Defaults.encryptInArmored = decryptFromArmored diff --git a/passTests/Models/QRKeyScannerTest.swift b/passTests/Models/QRKeyScannerTest.swift index ba8478e..867e304 100644 --- a/passTests/Models/QRKeyScannerTest.swift +++ b/passTests/Models/QRKeyScannerTest.swift @@ -11,12 +11,12 @@ import XCTest @testable import Pass class QRKeyScannerTest: XCTestCase { - let header = "-----BEGIN PGP PUBLIC KEY BLOCK-----" - let body = "key body" - let footer = "-----END PGP PUBLIC KEY BLOCK-----" - let privateHeader = "-----BEGIN PGP PRIVATE KEY BLOCK-----" + private let header = "-----BEGIN PGP PUBLIC KEY BLOCK-----" + private let body = "key body" + private let footer = "-----END PGP PUBLIC KEY BLOCK-----" + private let privateHeader = "-----BEGIN PGP PRIVATE KEY BLOCK-----" - var scanner = QRKeyScanner(keyType: .pgpPublic) + private var scanner = QRKeyScanner(keyType: .pgpPublic) func testAddHeaderTwice() { XCTAssertEqual(scanner.add(segment: header), .scanned(1)) diff --git a/scripts/swiftlint.sh b/scripts/swiftlint.sh index fc0c82d..673350f 100755 --- a/scripts/swiftlint.sh +++ b/scripts/swiftlint.sh @@ -1,4 +1,4 @@ -SWIFTLINT_VERSION="0.40.*" +SWIFTLINT_VERSION="0.41.*" if [[ -f "${SRCROOT}/.ci-env" ]]; then echo "Running in a Continuous Integration environment. Linting is skipped."