From 55e2cd793901588857bc0b34f89594da6bae77d3 Mon Sep 17 00:00:00 2001 From: Danny Moesch Date: Sun, 5 Jul 2020 00:25:34 +0200 Subject: [PATCH] Enable SwiftLint rule 'multiline_literal_brackets' and fix all violations --- .swiftlint.yml | 2 +- .../AboutRepositoryTableViewController.swift | 14 ++-- .../AboutTableViewController.swift | 14 ++-- ...nSourceComponentsTableViewController.swift | 64 ++++++++++++------- .../SpecialThanksTableViewController.swift | 24 ++++--- .../Controllers/ExtensionViewController.swift | 6 +- 6 files changed, 78 insertions(+), 46 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index daf3cb8..1534744 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -99,7 +99,7 @@ whitelist_rules: - multiline_arguments - multiline_arguments_brackets - multiline_function_chains -# - multiline_literal_brackets + - multiline_literal_brackets # - multiline_parameters # - multiline_parameters_brackets # - multiple_closures_with_trailing_closure diff --git a/pass/Controllers/AboutRepositoryTableViewController.swift b/pass/Controllers/AboutRepositoryTableViewController.swift index 761ce4b..149d918 100644 --- a/pass/Controllers/AboutRepositoryTableViewController.swift +++ b/pass/Controllers/AboutRepositoryTableViewController.swift @@ -61,12 +61,14 @@ class AboutRepositoryTableViewController: BasicStaticTableViewController { let type = UITableViewCell.AccessoryType.none strongSelf.tableData = [ // section 0 - [[.style: CellDataStyle.value1, .accessoryType: type, .title: "Passwords".localize(), .detailText: passwords], - [.style: CellDataStyle.value1, .accessoryType: type, .title: "Size".localize(), .detailText: size], - [.style: CellDataStyle.value1, .accessoryType: type, .title: "LocalCommits".localize(), .detailText: localCommits], - [.style: CellDataStyle.value1, .accessoryType: type, .title: "LastSynced".localize(), .detailText: lastSynced], - [.style: CellDataStyle.value1, .accessoryType: type, .title: "Commits".localize(), .detailText: commits], - [.title: "CommitLogs".localize(), .action: "segue", .link: "showCommitLogsSegue"]], + [ + [.style: CellDataStyle.value1, .accessoryType: type, .title: "Passwords".localize(), .detailText: passwords], + [.style: CellDataStyle.value1, .accessoryType: type, .title: "Size".localize(), .detailText: size], + [.style: CellDataStyle.value1, .accessoryType: type, .title: "LocalCommits".localize(), .detailText: localCommits], + [.style: CellDataStyle.value1, .accessoryType: type, .title: "LastSynced".localize(), .detailText: lastSynced], + [.style: CellDataStyle.value1, .accessoryType: type, .title: "Commits".localize(), .detailText: commits], + [.title: "CommitLogs".localize(), .action: "segue", .link: "showCommitLogsSegue"], + ], ] strongSelf.indicator.stopAnimating() strongSelf.tableView.reloadData() diff --git a/pass/Controllers/AboutTableViewController.swift b/pass/Controllers/AboutTableViewController.swift index 145a3b5..188ac51 100644 --- a/pass/Controllers/AboutTableViewController.swift +++ b/pass/Controllers/AboutTableViewController.swift @@ -12,13 +12,17 @@ class AboutTableViewController: BasicStaticTableViewController { override func viewDidLoad() { tableData = [ // section 0 - [[.title: "Website".localize(), .action: "link", .link: "https://github.com/mssun/pass-ios.git"], - [.title: "Help".localize(), .action: "link", .link: "https://github.com/mssun/passforios/wiki"], - [.title: "ContactDeveloper".localize(), .action: "link", .link: "mailto:developer@passforios.mssun.me?subject=Pass%20for%20iOS"]], + [ + [.title: "Website".localize(), .action: "link", .link: "https://github.com/mssun/pass-ios.git"], + [.title: "Help".localize(), .action: "link", .link: "https://github.com/mssun/passforios/wiki"], + [.title: "ContactDeveloper".localize(), .action: "link", .link: "mailto:developer@passforios.mssun.me?subject=Pass%20for%20iOS"], + ], // section 1, - [[.title: "OpenSourceComponents".localize(), .action: "segue", .link: "showOpenSourceComponentsSegue"], - [.title: "SpecialThanks".localize(), .action: "segue", .link: "showSpecialThanksSegue"]], + [ + [.title: "OpenSourceComponents".localize(), .action: "segue", .link: "showOpenSourceComponentsSegue"], + [.title: "SpecialThanks".localize(), .action: "segue", .link: "showSpecialThanksSegue"], + ], ] super.viewDidLoad() } diff --git a/pass/Controllers/OpenSourceComponentsTableViewController.swift b/pass/Controllers/OpenSourceComponentsTableViewController.swift index 7ab43f3..f0181b1 100644 --- a/pass/Controllers/OpenSourceComponentsTableViewController.swift +++ b/pass/Controllers/OpenSourceComponentsTableViewController.swift @@ -11,30 +11,46 @@ import UIKit class OpenSourceComponentsTableViewController: BasicStaticTableViewController { private static let openSourceComponents = [ - ["FavIcon", - "https://github.com/bitserf/FavIcon", - "https://github.com/bitserf/FavIcon/blob/master/LICENSE"], - ["GopenPGP", - "https://gopenpgp.org/", - "https://github.com/ProtonMail/gopenpgp/blob/master/LICENSE"], - ["KeychainAccess", - "https://github.com/kishikawakatsumi/KeychainAccess", - "https://github.com/kishikawakatsumi/KeychainAccess/blob/master/LICENSE"], - ["ObjectiveGit", - "https://github.com/libgit2/objective-git", - "https://github.com/libgit2/objective-git/blob/master/LICENSE"], - ["OneTimePassword", - "https://github.com/mattrubin/OneTimePassword", - "https://github.com/mattrubin/OneTimePassword/blob/develop/LICENSE.md"], - ["SVProgressHUD", - "https://github.com/SVProgressHUD/SVProgressHUD", - "https://github.com/SVProgressHUD/SVProgressHUD/blob/master/LICENSE"], - ["SwiftyUserDefaults", - "https://github.com/radex/SwiftyUserDefaults", - "https://github.com/radex/SwiftyUserDefaults/blob/master/LICENSE"], - ["EFF's Wordlists", - "https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases", - "http://creativecommons.org/licenses/by/3.0"], + [ + "FavIcon", + "https://github.com/bitserf/FavIcon", + "https://github.com/bitserf/FavIcon/blob/master/LICENSE", + ], + [ + "GopenPGP", + "https://gopenpgp.org/", + "https://github.com/ProtonMail/gopenpgp/blob/master/LICENSE", + ], + [ + "KeychainAccess", + "https://github.com/kishikawakatsumi/KeychainAccess", + "https://github.com/kishikawakatsumi/KeychainAccess/blob/master/LICENSE", + ], + [ + "ObjectiveGit", + "https://github.com/libgit2/objective-git", + "https://github.com/libgit2/objective-git/blob/master/LICENSE", + ], + [ + "OneTimePassword", + "https://github.com/mattrubin/OneTimePassword", + "https://github.com/mattrubin/OneTimePassword/blob/develop/LICENSE.md", + ], + [ + "SVProgressHUD", + "https://github.com/SVProgressHUD/SVProgressHUD", + "https://github.com/SVProgressHUD/SVProgressHUD/blob/master/LICENSE", + ], + [ + "SwiftyUserDefaults", + "https://github.com/radex/SwiftyUserDefaults", + "https://github.com/radex/SwiftyUserDefaults/blob/master/LICENSE", + ], + [ + "EFF's Wordlists", + "https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases", + "http://creativecommons.org/licenses/by/3.0", + ], ] override func viewDidLoad() { diff --git a/pass/Controllers/SpecialThanksTableViewController.swift b/pass/Controllers/SpecialThanksTableViewController.swift index 130ad5f..8d772f7 100644 --- a/pass/Controllers/SpecialThanksTableViewController.swift +++ b/pass/Controllers/SpecialThanksTableViewController.swift @@ -10,14 +10,22 @@ import UIKit class SpecialThanksTableViewController: BasicStaticTableViewController { let openSourceComponents = [ - ["Contributors".localize(), - "https://github.com/mssun/passforios/graphs/contributors"], - ["Password Store", - "https://passwordstore.org"], - ["Icon8", - "https://icons8.com"], - ["FlatIcon", - "https://www.flaticon.com"], + [ + "Contributors".localize(), + "https://github.com/mssun/passforios/graphs/contributors", + ], + [ + "Password Store", + "https://passwordstore.org", + ], + [ + "Icon8", + "https://icons8.com", + ], + [ + "FlatIcon", + "https://www.flaticon.com", + ], ] override func viewDidLoad() { diff --git a/passExtension/Controllers/ExtensionViewController.swift b/passExtension/Controllers/ExtensionViewController.swift index aa02b24..4362b0e 100644 --- a/passExtension/Controllers/ExtensionViewController.swift +++ b/passExtension/Controllers/ExtensionViewController.swift @@ -162,8 +162,10 @@ class ExtensionViewController: UIViewController, UITableViewDataSource, UITableV switch self.extensionAction { case .findLogin: let extensionItem = NSExtensionItem() - var returnDictionary = [OnePasswordExtensionKey.usernameKey: username, - OnePasswordExtensionKey.passwordKey: password] + var returnDictionary = [ + OnePasswordExtensionKey.usernameKey: username, + OnePasswordExtensionKey.passwordKey: password, + ] if let totpPassword = decryptedPassword.currentOtp { returnDictionary[OnePasswordExtensionKey.totpKey] = totpPassword }