Update SwiftLint and SwiftFormat (#613)
* Update Swift version used by SwiftFormat * Update SwiftLint version * Rely on new virtual 'all' rule in SwiftLint * Enable SwiftLint rule 'direct_return' rule and fix all violations * Enable SwiftLint rule 'shorthand_optional_binding' rule and fix all violations * Enable SwiftLint rule 'blanket_disable_command' rule and fix all violations
This commit is contained in:
parent
a22e872a8c
commit
d9bd0f3014
24 changed files with 90 additions and 272 deletions
|
|
@ -72,7 +72,7 @@ struct GopenPGPInterface: PGPInterface {
|
|||
|
||||
func decrypt(encryptedData: Data, keyID: String?, passphrase: String) throws -> Data? {
|
||||
let key: CryptoKey? = {
|
||||
if let keyID = keyID {
|
||||
if let keyID {
|
||||
return privateKeys.first(where: { key, _ in key.hasSuffix(keyID.lowercased()) })?.value
|
||||
}
|
||||
return privateKeys.first?.value
|
||||
|
|
@ -109,7 +109,7 @@ struct GopenPGPInterface: PGPInterface {
|
|||
|
||||
func encrypt(plainData: Data, keyID: String?) throws -> Data {
|
||||
let key: CryptoKey? = {
|
||||
if let keyID = keyID {
|
||||
if let keyID {
|
||||
return publicKeys.first(where: { key, _ in key.hasSuffix(keyID.lowercased()) })?.value
|
||||
}
|
||||
return publicKeys.first?.value
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class PGPAgent {
|
|||
public func decrypt(encryptedData: Data, keyID: String, requestPGPKeyPassphrase: @escaping (String) -> String) throws -> Data? {
|
||||
// Init keys.
|
||||
try checkAndInit()
|
||||
guard let pgpInterface = pgpInterface else {
|
||||
guard let pgpInterface else {
|
||||
throw AppError.decryption
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ public class PGPAgent {
|
|||
|
||||
public func encrypt(plainData: Data, keyID: String) throws -> Data {
|
||||
try checkAndInit()
|
||||
guard let pgpInterface = pgpInterface else {
|
||||
guard let pgpInterface else {
|
||||
throw AppError.encryption
|
||||
}
|
||||
var keyID = keyID
|
||||
|
|
@ -120,7 +120,7 @@ public class PGPAgent {
|
|||
|
||||
public func encrypt(plainData: Data) throws -> Data {
|
||||
try checkAndInit()
|
||||
guard let pgpInterface = pgpInterface else {
|
||||
guard let pgpInterface else {
|
||||
throw AppError.encryption
|
||||
}
|
||||
return try pgpInterface.encrypt(plainData: plainData, keyID: nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue