Use SwiftFormat version 0.48.x

This commit is contained in:
Danny Moesch 2021-04-24 16:47:09 +02:00 committed by Mingshen Sun
parent 56a5cbe5cb
commit 7cbc14978a
6 changed files with 9 additions and 5 deletions

View file

@ -130,7 +130,7 @@ class GitRepositorySettingsTableViewController: UITableViewController, PasswordA
if let scheme = gitURL.scheme {
switch scheme {
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)
return
}

View file

@ -371,7 +371,7 @@ class PasswordEditorTableViewController: UITableViewController {
var previousPathLength = Int.max
while passwordURL.path != "." {
passwordURL = passwordURL.deletingLastPathComponent()
if passwordURL.path != "." && passwordURL.path.count >= previousPathLength {
if passwordURL.path != ".", passwordURL.path.count >= previousPathLength {
Utils.alert(title: "CannotSave".localize(), message: "CannotParseFilename.".localize(), controller: self, completion: nil)
return false
}

View file

@ -289,7 +289,7 @@ extension PasswordNavigationViewController {
return false
}
} else if identifier == "addPasswordSegue" {
guard PGPAgent.shared.isPrepared && PasswordStore.shared.storeRepository != nil else {
guard PGPAgent.shared.isPrepared, PasswordStore.shared.storeRepository != nil else {
Utils.alert(title: "CannotAddPassword".localize(), message: "MakeSurePgpAndGitProperlySet.".localize(), controller: self)
return false
}