Enable SwiftLint rule 'multiline_literal_brackets' and fix all violations

This commit is contained in:
Danny Moesch 2020-07-05 00:25:34 +02:00 committed by Mingshen Sun
parent 776c813f94
commit 55e2cd7939
6 changed files with 78 additions and 46 deletions

View file

@ -99,7 +99,7 @@ whitelist_rules:
- multiline_arguments - multiline_arguments
- multiline_arguments_brackets - multiline_arguments_brackets
- multiline_function_chains - multiline_function_chains
# - multiline_literal_brackets - multiline_literal_brackets
# - multiline_parameters # - multiline_parameters
# - multiline_parameters_brackets # - multiline_parameters_brackets
# - multiple_closures_with_trailing_closure # - multiple_closures_with_trailing_closure

View file

@ -61,12 +61,14 @@ class AboutRepositoryTableViewController: BasicStaticTableViewController {
let type = UITableViewCell.AccessoryType.none let type = UITableViewCell.AccessoryType.none
strongSelf.tableData = [ strongSelf.tableData = [
// section 0 // section 0
[[.style: CellDataStyle.value1, .accessoryType: type, .title: "Passwords".localize(), .detailText: passwords], [
[.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: "Size".localize(), .detailText: size],
[.style: CellDataStyle.value1, .accessoryType: type, .title: "LocalCommits".localize(), .detailText: localCommits], [.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: "LastSynced".localize(), .detailText: lastSynced],
[.style: CellDataStyle.value1, .accessoryType: type, .title: "Commits".localize(), .detailText: commits], [.style: CellDataStyle.value1, .accessoryType: type, .title: "Commits".localize(), .detailText: commits],
[.title: "CommitLogs".localize(), .action: "segue", .link: "showCommitLogsSegue"]], [.title: "CommitLogs".localize(), .action: "segue", .link: "showCommitLogsSegue"],
],
] ]
strongSelf.indicator.stopAnimating() strongSelf.indicator.stopAnimating()
strongSelf.tableView.reloadData() strongSelf.tableView.reloadData()

View file

@ -12,13 +12,17 @@ class AboutTableViewController: BasicStaticTableViewController {
override func viewDidLoad() { override func viewDidLoad() {
tableData = [ tableData = [
// section 0 // section 0
[[.title: "Website".localize(), .action: "link", .link: "https://github.com/mssun/pass-ios.git"], [
[.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: "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: "ContactDeveloper".localize(), .action: "link", .link: "mailto:developer@passforios.mssun.me?subject=Pass%20for%20iOS"],
],
// section 1, // 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() super.viewDidLoad()
} }

View file

@ -11,30 +11,46 @@ import UIKit
class OpenSourceComponentsTableViewController: BasicStaticTableViewController { class OpenSourceComponentsTableViewController: BasicStaticTableViewController {
private static let openSourceComponents = [ private static let openSourceComponents = [
["FavIcon", [
"FavIcon",
"https://github.com/bitserf/FavIcon", "https://github.com/bitserf/FavIcon",
"https://github.com/bitserf/FavIcon/blob/master/LICENSE"], "https://github.com/bitserf/FavIcon/blob/master/LICENSE",
["GopenPGP", ],
[
"GopenPGP",
"https://gopenpgp.org/", "https://gopenpgp.org/",
"https://github.com/ProtonMail/gopenpgp/blob/master/LICENSE"], "https://github.com/ProtonMail/gopenpgp/blob/master/LICENSE",
["KeychainAccess", ],
[
"KeychainAccess",
"https://github.com/kishikawakatsumi/KeychainAccess", "https://github.com/kishikawakatsumi/KeychainAccess",
"https://github.com/kishikawakatsumi/KeychainAccess/blob/master/LICENSE"], "https://github.com/kishikawakatsumi/KeychainAccess/blob/master/LICENSE",
["ObjectiveGit", ],
[
"ObjectiveGit",
"https://github.com/libgit2/objective-git", "https://github.com/libgit2/objective-git",
"https://github.com/libgit2/objective-git/blob/master/LICENSE"], "https://github.com/libgit2/objective-git/blob/master/LICENSE",
["OneTimePassword", ],
[
"OneTimePassword",
"https://github.com/mattrubin/OneTimePassword", "https://github.com/mattrubin/OneTimePassword",
"https://github.com/mattrubin/OneTimePassword/blob/develop/LICENSE.md"], "https://github.com/mattrubin/OneTimePassword/blob/develop/LICENSE.md",
["SVProgressHUD", ],
[
"SVProgressHUD",
"https://github.com/SVProgressHUD/SVProgressHUD", "https://github.com/SVProgressHUD/SVProgressHUD",
"https://github.com/SVProgressHUD/SVProgressHUD/blob/master/LICENSE"], "https://github.com/SVProgressHUD/SVProgressHUD/blob/master/LICENSE",
["SwiftyUserDefaults", ],
[
"SwiftyUserDefaults",
"https://github.com/radex/SwiftyUserDefaults", "https://github.com/radex/SwiftyUserDefaults",
"https://github.com/radex/SwiftyUserDefaults/blob/master/LICENSE"], "https://github.com/radex/SwiftyUserDefaults/blob/master/LICENSE",
["EFF's Wordlists", ],
[
"EFF's Wordlists",
"https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases", "https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases",
"http://creativecommons.org/licenses/by/3.0"], "http://creativecommons.org/licenses/by/3.0",
],
] ]
override func viewDidLoad() { override func viewDidLoad() {

View file

@ -10,14 +10,22 @@ import UIKit
class SpecialThanksTableViewController: BasicStaticTableViewController { class SpecialThanksTableViewController: BasicStaticTableViewController {
let openSourceComponents = [ let openSourceComponents = [
["Contributors".localize(), [
"https://github.com/mssun/passforios/graphs/contributors"], "Contributors".localize(),
["Password Store", "https://github.com/mssun/passforios/graphs/contributors",
"https://passwordstore.org"], ],
["Icon8", [
"https://icons8.com"], "Password Store",
["FlatIcon", "https://passwordstore.org",
"https://www.flaticon.com"], ],
[
"Icon8",
"https://icons8.com",
],
[
"FlatIcon",
"https://www.flaticon.com",
],
] ]
override func viewDidLoad() { override func viewDidLoad() {

View file

@ -162,8 +162,10 @@ class ExtensionViewController: UIViewController, UITableViewDataSource, UITableV
switch self.extensionAction { switch self.extensionAction {
case .findLogin: case .findLogin:
let extensionItem = NSExtensionItem() let extensionItem = NSExtensionItem()
var returnDictionary = [OnePasswordExtensionKey.usernameKey: username, var returnDictionary = [
OnePasswordExtensionKey.passwordKey: password] OnePasswordExtensionKey.usernameKey: username,
OnePasswordExtensionKey.passwordKey: password,
]
if let totpPassword = decryptedPassword.currentOtp { if let totpPassword = decryptedPassword.currentOtp {
returnDictionary[OnePasswordExtensionKey.totpKey] = totpPassword returnDictionary[OnePasswordExtensionKey.totpKey] = totpPassword
} }