build: Fix swiftlint warnings

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2021-08-02 13:49:47 +05:30 committed by Jason A. Donenfeld
parent 73c708d902
commit a8226b35d2
8 changed files with 7 additions and 8 deletions

View File

@ -236,7 +236,7 @@ class TunnelsManager {
tunnelProviderManager.saveToPreferences { [weak self] error in tunnelProviderManager.saveToPreferences { [weak self] error in
if let error = error { if let error = error {
//TODO: the passwordReference for the old one has already been removed at this point and we can't easily roll back! // TODO: the passwordReference for the old one has already been removed at this point and we can't easily roll back!
wg_log(.error, message: "Modify: Saving configuration failed: \(error)") wg_log(.error, message: "Modify: Saving configuration failed: \(error)")
completionHandler(TunnelsManagerError.systemErrorOnModifyTunnel(systemError: error)) completionHandler(TunnelsManagerError.systemErrorOnModifyTunnel(systemError: error))
return return

View File

@ -15,7 +15,7 @@ extension UITableView {
} }
func dequeueReusableCell<T: UITableViewCell>(for indexPath: IndexPath) -> T { func dequeueReusableCell<T: UITableViewCell>(for indexPath: IndexPath) -> T {
//swiftlint:disable:next force_cast // swiftlint:disable:next force_cast
return dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath) as! T return dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath) as! T
} }
} }

View File

@ -324,4 +324,3 @@ extension SSIDOptionEditTableViewController {
} }
} }
} }

View File

@ -318,7 +318,7 @@ extension TunnelEditTableViewController {
let removedSectionIndices = self.deletePeer(peer: peerData) let removedSectionIndices = self.deletePeer(peer: peerData)
let shouldShowExcludePrivateIPs = (self.tunnelViewModel.peersData.count == 1 && self.tunnelViewModel.peersData[0].shouldAllowExcludePrivateIPsControl) let shouldShowExcludePrivateIPs = (self.tunnelViewModel.peersData.count == 1 && self.tunnelViewModel.peersData[0].shouldAllowExcludePrivateIPsControl)
//swiftlint:disable:next trailing_closure // swiftlint:disable:next trailing_closure
tableView.performBatchUpdates({ tableView.performBatchUpdates({
self.tableView.deleteSections(removedSectionIndices, with: .fade) self.tableView.deleteSections(removedSectionIndices, with: .fade)
if shouldShowExcludePrivateIPs { if shouldShowExcludePrivateIPs {

View File

@ -5,7 +5,7 @@ import Cocoa
class Application: NSApplication { class Application: NSApplication {
private var appDelegate: AppDelegate? //swiftlint:disable:this weak_delegate private var appDelegate: AppDelegate? // swiftlint:disable:this weak_delegate
override init() { override init() {
super.init() super.init()

View File

@ -7,7 +7,7 @@ extension NSTableView {
func dequeueReusableCell<T: NSView>() -> T { func dequeueReusableCell<T: NSView>() -> T {
let identifier = NSUserInterfaceItemIdentifier(NSStringFromClass(T.self)) let identifier = NSUserInterfaceItemIdentifier(NSStringFromClass(T.self))
if let cellView = makeView(withIdentifier: identifier, owner: self) { if let cellView = makeView(withIdentifier: identifier, owner: self) {
//swiftlint:disable:next force_cast // swiftlint:disable:next force_cast
return cellView as! T return cellView as! T
} }
let cellView = T() let cellView = T()

View File

@ -16,7 +16,7 @@ class ConfTextStorage: NSTextStorage {
private(set) var hasError = false private(set) var hasError = false
private(set) var privateKeyString: String? private(set) var privateKeyString: String?
private(set) var hasOnePeer: Bool = false private(set) var hasOnePeer = false
private(set) var lastOnePeerAllowedIPs = [String]() private(set) var lastOnePeerAllowedIPs = [String]()
private(set) var lastOnePeerDNSServers = [String]() private(set) var lastOnePeerDNSServers = [String]()
private(set) var lastOnePeerHasPublicKey = false private(set) var lastOnePeerHasPublicKey = false

View File

@ -7,7 +7,7 @@ class ConfTextView: NSTextView {
private let confTextStorage = ConfTextStorage() private let confTextStorage = ConfTextStorage()
@objc dynamic var hasError: Bool = false @objc dynamic var hasError = false
@objc dynamic var privateKeyString: String? @objc dynamic var privateKeyString: String?
@objc dynamic var singlePeerAllowedIPs: [String]? @objc dynamic var singlePeerAllowedIPs: [String]?