Run updated SwiftFormat

This commit is contained in:
Danny Moesch 2020-12-18 10:03:47 +01:00 committed by Mingshen Sun
parent a49f0ee5e0
commit 1a8692bde3
6 changed files with 11 additions and 11 deletions

View file

@ -122,7 +122,7 @@ class GitRepositorySettingsTableViewController: UITableViewController, PasswordA
if let scheme = gitURL.scheme { if let scheme = gitURL.scheme {
switch scheme { switch scheme {
case "ssh", "http", "https": case "http", "https", "ssh":
if gitURL.user == nil && usernameTextField.text == nil { if gitURL.user == nil && usernameTextField.text == nil {
Utils.alert(title: "CannotSave".localize(), message: "CannotFindUsername.".localize(), controller: self) Utils.alert(title: "CannotSave".localize(), message: "CannotFindUsername.".localize(), controller: self)
return return

View file

@ -425,7 +425,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
cell.categoryLabel.text = passwordEntity!.getCategoryText() cell.categoryLabel.text = passwordEntity!.getCategoryText()
cell.selectionStyle = .none cell.selectionStyle = .none
return cell return cell
case .main, .addition: case .addition, .main:
let cell = tableView.dequeueReusableCell(withIdentifier: "labelCell", for: indexPath) as! LabelTableViewCell let cell = tableView.dequeueReusableCell(withIdentifier: "labelCell", for: indexPath) as! LabelTableViewCell
let titleData = tableDataItem.title let titleData = tableDataItem.title
let contentData = tableDataItem.content let contentData = tableDataItem.content
@ -487,7 +487,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
override func tableView(_: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath, withSender _: Any?) -> Bool { override func tableView(_: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath, withSender _: Any?) -> Bool {
let section = tableData[indexPath.section] let section = tableData[indexPath.section]
switch section.type { switch section.type {
case .main, .addition: case .addition, .main:
return action == #selector(UIResponderStandardEditActions.copy(_:)) return action == #selector(UIResponderStandardEditActions.copy(_:))
default: default:
return false return false

View file

@ -211,9 +211,9 @@ class PasswordEditorTableViewController: UITableViewController {
override func tableView(_: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { override func tableView(_: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
switch tableData[indexPath.section][indexPath.row][PasswordEditorCellKey.type] as! PasswordEditorCellType { switch tableData[indexPath.section][indexPath.row][PasswordEditorCellKey.type] as! PasswordEditorCellType {
case .passwordLengthCell, .passwordGroupsCell: case .passwordGroupsCell, .passwordLengthCell:
return 42 return 42
case .passwordUseDigitsCell, .passwordVaryCasesCell, .passwordUseSpecialSymbols, .passwordFlavorCell: case .passwordFlavorCell, .passwordUseDigitsCell, .passwordUseSpecialSymbols, .passwordVaryCasesCell:
return 42 return 42
default: default:
return UITableView.automaticDimension return UITableView.automaticDimension

View file

@ -22,7 +22,7 @@ enum ScannableKeyType {
var headerStart: String { var headerStart: String {
switch self { switch self {
case .pgpPublic, .pgpPrivate: case .pgpPrivate, .pgpPublic:
return "-----BEGIN PGP \(visibility.uppercased()) KEY BLOCK-----" return "-----BEGIN PGP \(visibility.uppercased()) KEY BLOCK-----"
case .sshPrivate: case .sshPrivate:
return "-----BEGIN" return "-----BEGIN"
@ -31,7 +31,7 @@ enum ScannableKeyType {
var footerStart: String { var footerStart: String {
switch self { switch self {
case .pgpPublic, .pgpPrivate: case .pgpPrivate, .pgpPublic:
return "-----END PGP \(visibility.uppercased())" return "-----END PGP \(visibility.uppercased())"
case .sshPrivate: case .sshPrivate:
return "-----END" return "-----END"
@ -40,7 +40,7 @@ enum ScannableKeyType {
var footerEnd: String { var footerEnd: String {
switch self { switch self {
case .pgpPublic, .pgpPrivate: case .pgpPrivate, .pgpPublic:
return "KEY BLOCK-----" return "KEY BLOCK-----"
case .sshPrivate: case .sshPrivate:
return "KEY-----" return "KEY-----"

View file

@ -192,7 +192,7 @@ open class PasscodeLockViewController: UIViewController, UITextFieldDelegate {
UIAlertAction(title: "ErasePasswordStoreData".localize(), style: UIAlertAction.Style.destructive) { [unowned self] _ -> Void in UIAlertAction(title: "ErasePasswordStoreData".localize(), style: UIAlertAction.Style.destructive) { [unowned self] _ -> Void in
let myContext = LAContext() let myContext = LAContext()
// If the device passcode is not set, reset the app. // If the device passcode is not set, reset the app.
guard myContext.canEvaluatePolicy(.deviceOwnerAuthentication, error: nil)else { guard myContext.canEvaluatePolicy(.deviceOwnerAuthentication, error: nil) else {
self.passwordStore.erase() self.passwordStore.erase()
self.passcodeLockDidSucceed() self.passcodeLockDidSucceed()
return return

View file

@ -33,9 +33,9 @@ extension AppError: LocalizedError {
let enumName = String(describing: self) let enumName = String(describing: self)
let localizationKey = "\(enumName.first!.uppercased())\(enumName.dropFirst().prefix { $0 != "(" })Error." let localizationKey = "\(enumName.first!.uppercased())\(enumName.dropFirst().prefix { $0 != "(" })Error."
switch self { switch self {
case let .repositoryRemoteBranchNotFound(name), let .repositoryBranchNotFound(name), let .readingFile(name): case let .readingFile(name), let .repositoryBranchNotFound(name), let .repositoryRemoteBranchNotFound(name):
return localizationKey.localize(name) return localizationKey.localize(name)
case let .pgpPublicKeyNotFound(keyID), let .pgpPrivateKeyNotFound(keyID): case let .pgpPrivateKeyNotFound(keyID), let .pgpPublicKeyNotFound(keyID):
return localizationKey.localize(keyID) return localizationKey.localize(keyID)
default: default:
return localizationKey.localize() return localizationKey.localize()