Enable SwiftLint rule 'multiline_parameters_brackets' and fix all violations
This commit is contained in:
parent
959ef659d2
commit
8828298afb
3 changed files with 27 additions and 19 deletions
|
|
@ -101,7 +101,7 @@ whitelist_rules:
|
||||||
- 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
|
||||||
# - nesting
|
# - nesting
|
||||||
- nimble_operator
|
- nimble_operator
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,11 @@ import Foundation
|
||||||
import passKit
|
import passKit
|
||||||
import SVProgressHUD
|
import SVProgressHUD
|
||||||
|
|
||||||
public func requestGitCredentialPassword(credential: GitCredential.Credential,
|
public func requestGitCredentialPassword(
|
||||||
|
credential: GitCredential.Credential,
|
||||||
lastPassword: String?,
|
lastPassword: String?,
|
||||||
controller: UIViewController) -> String? {
|
controller: UIViewController
|
||||||
|
) -> String? {
|
||||||
let sem = DispatchSemaphore(value: 0)
|
let sem = DispatchSemaphore(value: 0)
|
||||||
var password: String?
|
var password: String?
|
||||||
let message: String = {
|
let message: String = {
|
||||||
|
|
|
||||||
|
|
@ -171,12 +171,14 @@ public class PasswordStore {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func cloneRepository(remoteRepoURL: URL,
|
public func cloneRepository(
|
||||||
|
remoteRepoURL: URL,
|
||||||
credential: GitCredential,
|
credential: GitCredential,
|
||||||
branchName: String,
|
branchName: String,
|
||||||
requestCredentialPassword: @escaping (GitCredential.Credential, String?) -> String?,
|
requestCredentialPassword: @escaping (GitCredential.Credential, String?) -> String?,
|
||||||
transferProgressBlock: @escaping (UnsafePointer<git_transfer_progress>, UnsafeMutablePointer<ObjCBool>) -> Void,
|
transferProgressBlock: @escaping (UnsafePointer<git_transfer_progress>, UnsafeMutablePointer<ObjCBool>) -> Void,
|
||||||
checkoutProgressBlock: @escaping (String, UInt, UInt) -> Void) throws {
|
checkoutProgressBlock: @escaping (String, UInt, UInt) -> Void
|
||||||
|
) throws {
|
||||||
do {
|
do {
|
||||||
let credentialProvider = try credential.credentialProvider(requestCredentialPassword: requestCredentialPassword)
|
let credentialProvider = try credential.credentialProvider(requestCredentialPassword: requestCredentialPassword)
|
||||||
let options = [GTRepositoryCloneOptionsCredentialProvider: credentialProvider]
|
let options = [GTRepositoryCloneOptionsCredentialProvider: credentialProvider]
|
||||||
|
|
@ -187,12 +189,14 @@ public class PasswordStore {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func cloneRepository(remoteRepoURL: URL,
|
public func cloneRepository(
|
||||||
|
remoteRepoURL: URL,
|
||||||
options: [AnyHashable: Any]? = nil,
|
options: [AnyHashable: Any]? = nil,
|
||||||
branchName: String,
|
branchName: String,
|
||||||
transferProgressBlock: @escaping (UnsafePointer<git_transfer_progress>, UnsafeMutablePointer<ObjCBool>) -> Void,
|
transferProgressBlock: @escaping (UnsafePointer<git_transfer_progress>, UnsafeMutablePointer<ObjCBool>) -> Void,
|
||||||
checkoutProgressBlock: @escaping (String, UInt, UInt) -> Void,
|
checkoutProgressBlock: @escaping (String, UInt, UInt) -> Void,
|
||||||
completion: @escaping () -> Void = {}) throws {
|
completion: @escaping () -> Void = {}
|
||||||
|
) throws {
|
||||||
try? fm.removeItem(at: storeURL)
|
try? fm.removeItem(at: storeURL)
|
||||||
try? fm.removeItem(at: tempStoreURL)
|
try? fm.removeItem(at: tempStoreURL)
|
||||||
gitPassword = nil
|
gitPassword = nil
|
||||||
|
|
@ -241,9 +245,11 @@ public class PasswordStore {
|
||||||
try storeRepository.moveHEAD(to: localBranch.reference)
|
try storeRepository.moveHEAD(to: localBranch.reference)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func pullRepository(credential: GitCredential,
|
public func pullRepository(
|
||||||
|
credential: GitCredential,
|
||||||
requestCredentialPassword: @escaping (GitCredential.Credential, String?) -> String?,
|
requestCredentialPassword: @escaping (GitCredential.Credential, String?) -> String?,
|
||||||
progressBlock: @escaping (UnsafePointer<git_transfer_progress>, UnsafeMutablePointer<ObjCBool>) -> Void) throws {
|
progressBlock: @escaping (UnsafePointer<git_transfer_progress>, UnsafeMutablePointer<ObjCBool>) -> Void
|
||||||
|
) throws {
|
||||||
guard let storeRepository = storeRepository else {
|
guard let storeRepository = storeRepository else {
|
||||||
throw AppError.RepositoryNotSet
|
throw AppError.RepositoryNotSet
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue