Format code with SwiftFormat automatically in every build

This commit is contained in:
Danny Moesch 2020-06-28 21:25:40 +02:00 committed by Mingshen Sun
parent f167ab7549
commit 7f9f0e43b2
100 changed files with 1124 additions and 1063 deletions

View file

@ -21,15 +21,15 @@ class DictBasedKeychain: KeyStore {
}
public func contains(key: String) -> Bool {
return store[key] != nil
store[key] != nil
}
public func get(for key: String) -> Data? {
return store[key] as? Data
store[key] as? Data
}
public func get(for key: String) -> String? {
return store[key] as? String
store[key] as? String
}
public func removeContent(for key: String) {

View file

@ -29,7 +29,7 @@ let MULTILINE_BLOCK_START = "multiline block" => "|"
let MULTILINE_LINE_START = "multiline line" => ">"
func getPasswordObjectWith(content: String, url: URL? = nil) -> Password {
return Password(name: "password", url: url ?? PASSWORD_URL, plainText: content)
Password(name: "password", url: url ?? PASSWORD_URL, plainText: content)
}
func assertDefaults(in password: Password, with passwordString: String, and additions: String,
@ -44,11 +44,11 @@ func assertDefaults(in password: Password, with passwordString: String, and addi
}
infix operator : AdditionPrecedence
func (field: AdditionField, password: Password) -> Bool {
return password.getFilteredAdditions().contains(field)
func (field: AdditionField, password: Password) -> Bool {
password.getFilteredAdditions().contains(field)
}
infix operator : AdditionPrecedence
func (field: AdditionField, password: Password) -> Bool {
return !(field password)
func (field: AdditionField, password: Password) -> Bool {
!(field password)
}

View file

@ -11,7 +11,6 @@ import XCTest
@testable import passKit
struct PGPTestSet {
fileprivate static var ALL_TEST_SETS: [String: PGPTestSet] = [:]
let publicKey: String
@ -81,14 +80,14 @@ let NISTP384 = PGPTestSet(
passphrase: "soirofssap"
).collect()
let RSA2048_RSA4096 = MultiKeyPGPTestSet(
let RSA2048_RSA4096 = MultiKeyPGPTestSet(
publicKeys: PGP_RSA2048_PUBLIC_KEY | PGP_RSA4096_PUBLIC_KEY,
privateKeys: PGP_RSA2048_PRIVATE_KEY | PGP_RSA4096_PRIVATE_KEY,
fingerprints: ["a1024dae", "d862027e"],
passphrases: ["passforios", "passforios"]
)
let ED25519_NISTP384 = MultiKeyPGPTestSet(
let ED25519_NISTP384 = MultiKeyPGPTestSet(
publicKeys: PGP_ED25519_PUBLIC_KEY | PGP_NISTP384_PUBLIC_KEY,
privateKeys: PGP_ED25519_PRIVATE_KEY | PGP_NISTP384_PRIVATE_KEY,
fingerprints: ["e9444483", "5af3c085"],