Rely on SPM plugins to consume SwiftLint and SwiftFormat
Use their latest releases and fix some violations and issues. # Conflicts: # .github/workflows/linting.yml # .github/workflows/testing.yml
This commit is contained in:
parent
358908f161
commit
1bdf9d684b
40 changed files with 126 additions and 186 deletions
|
|
@ -8,11 +8,12 @@
|
|||
|
||||
import XCTest
|
||||
|
||||
// swiftformat:disable:next sortedImports
|
||||
@testable import passKit
|
||||
@testable import Gopenpgp
|
||||
|
||||
class CryptoFrameworkTest: XCTestCase {
|
||||
// swiftformat:disable:next sortedImports
|
||||
@testable import passKit
|
||||
|
||||
final class CryptoFrameworkTest: XCTestCase {
|
||||
private typealias MessageConverter = (CryptoPGPMessage, NSErrorPointer) -> CryptoPGPMessage?
|
||||
|
||||
private let testText = "Hello World!"
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class PGPAgentTest: XCTestCase {
|
||||
final class PGPAgentTest: XCTestCase {
|
||||
private var keychain: KeyStore!
|
||||
private var pgpAgent: PGPAgent!
|
||||
|
||||
private let testData = "Hello World!".data(using: .utf8)!
|
||||
private let testData = Data("Hello World!".utf8)
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class ArraySlicesTest: XCTestCase {
|
||||
final class ArraySlicesTest: XCTestCase {
|
||||
func testZeroCount() {
|
||||
XCTAssertEqual([1, 2, 3].slices(count: 0), [])
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class StringUtilitiesTest: XCTestCase {
|
||||
final class StringUtilitiesTest: XCTestCase {
|
||||
func testTrimmed() {
|
||||
[
|
||||
(" ", ""),
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class KeyFileManagerTest: XCTestCase {
|
||||
final class KeyFileManagerTest: XCTestCase {
|
||||
private static let filePath = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("test.txt").path
|
||||
private static let keyFileManager = KeyFileManager(keyType: PGPKey.PUBLIC, keyPath: filePath) { _, _ in }
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import ObjectiveGit
|
|||
import SwiftyUserDefaults
|
||||
@testable import passKit
|
||||
|
||||
class GitCredentialTest: XCTestCase {
|
||||
final class GitCredentialTest: XCTestCase {
|
||||
private static let defaultsID = "SharedDefaultsForGitCredentialTest"
|
||||
|
||||
private let keyStore = DictBasedKeychain()
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class PasswordStoreTest: XCTestCase {
|
||||
final class PasswordStoreTest: XCTestCase {
|
||||
private let remoteRepoURL = URL(string: "https://github.com/mssun/passforios-password-store.git")!
|
||||
|
||||
func testCloneAndDecryptMultiKeys() throws {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class PasswordTableEntryTest: XCTestCase {
|
||||
final class PasswordTableEntryTest: XCTestCase {
|
||||
func testExample() {
|
||||
let nameWithCategoryList = [
|
||||
"github",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class PasswordTest: XCTestCase {
|
||||
final class PasswordTest: XCTestCase {
|
||||
func testURL() {
|
||||
let password = getPasswordObjectWith(content: "")
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class AdditionFieldTest: XCTestCase {
|
||||
final class AdditionFieldTest: XCTestCase {
|
||||
func testAdditionField() {
|
||||
let field1 = AdditionField(title: "key", content: "value")
|
||||
let field2 = AdditionField(title: "no content")
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class ConstantsTest: XCTestCase {
|
||||
final class ConstantsTest: XCTestCase {
|
||||
func testIsOtpRelated() {
|
||||
XCTAssert(Constants.isOtpRelated(line: "otpauth://something"))
|
||||
XCTAssert(Constants.isOtpRelated(line: "otp_algorithm: algorithm"))
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class OTPTypeTest: XCTestCase {
|
||||
final class OTPTypeTest: XCTestCase {
|
||||
func testInitFromToken() {
|
||||
let secret = "secret".data(using: .utf8)!
|
||||
let secret = Data("secret".utf8)
|
||||
|
||||
let totpGenerator = Generator(factor: .timer(period: 30.0), secret: secret, algorithm: .sha1, digits: 6)!
|
||||
let totpToken = Token(name: "", issuer: "", generator: totpGenerator)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
import XCTest
|
||||
@testable import passKit
|
||||
|
||||
class ParserTest: XCTestCase {
|
||||
final class ParserTest: XCTestCase {
|
||||
func testInit() {
|
||||
[
|
||||
("", "", "", []),
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class TokenBuilderTest: XCTestCase {
|
||||
final class TokenBuilderTest: XCTestCase {
|
||||
private let SECRET = "secret"
|
||||
private let DIGITS = Constants.DEFAULT_DIGITS
|
||||
private let TIMER = Generator.Factor.timer(period: Constants.DEFAULT_PERIOD)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class PasswordGeneratorFlavorTest: XCTestCase {
|
||||
final class PasswordGeneratorFlavorTest: XCTestCase {
|
||||
func testLengthLimits() {
|
||||
// Ensure properly chosen length limits. So this check no longer needs to be performed in the code.
|
||||
PasswordGeneratorFlavor.allCases.map(\.lengthLimits).forEach {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import XCTest
|
|||
|
||||
@testable import passKit
|
||||
|
||||
class PasswordGeneratorTest: XCTestCase {
|
||||
final class PasswordGeneratorTest: XCTestCase {
|
||||
func testLimitedLength() {
|
||||
[
|
||||
PasswordGenerator(length: 15),
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import XCTest
|
|||
@testable import passKit
|
||||
|
||||
struct PGPTestSet {
|
||||
fileprivate static var ALL_TEST_SETS: [String: PGPTestSet] = [:] // swiftlint:disable:this strict_fileprivate
|
||||
fileprivate static var ALL_TEST_SETS: [String: Self] = [:] // swiftlint:disable:this strict_fileprivate
|
||||
|
||||
let publicKey: String
|
||||
let privateKey: String
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue