From a8226b35d2a9773eed6665438257597e9a4aa711 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Mon, 2 Aug 2021 13:49:47 +0530 Subject: build: Fix swiftlint warnings Signed-off-by: Roopesh Chander --- Sources/WireGuardApp/Tunnel/TunnelsManager.swift | 2 +- Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.swift | 2 +- .../UI/iOS/ViewController/SSIDOptionEditTableViewController.swift | 1 - .../UI/iOS/ViewController/TunnelEditTableViewController.swift | 2 +- Sources/WireGuardApp/UI/macOS/Application.swift | 2 +- Sources/WireGuardApp/UI/macOS/NSTableView+Reuse.swift | 2 +- Sources/WireGuardApp/UI/macOS/View/ConfTextStorage.swift | 2 +- Sources/WireGuardApp/UI/macOS/View/ConfTextView.swift | 2 +- 8 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Sources/WireGuardApp/Tunnel/TunnelsManager.swift b/Sources/WireGuardApp/Tunnel/TunnelsManager.swift index fe3955b..83c48c9 100644 --- a/Sources/WireGuardApp/Tunnel/TunnelsManager.swift +++ b/Sources/WireGuardApp/Tunnel/TunnelsManager.swift @@ -236,7 +236,7 @@ class TunnelsManager { tunnelProviderManager.saveToPreferences { [weak self] error in 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)") completionHandler(TunnelsManagerError.systemErrorOnModifyTunnel(systemError: error)) return diff --git a/Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.swift b/Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.swift index fbe56a1..dc981d2 100644 --- a/Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.swift +++ b/Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.swift @@ -15,7 +15,7 @@ extension UITableView { } func dequeueReusableCell(for indexPath: IndexPath) -> T { - //swiftlint:disable:next force_cast + // swiftlint:disable:next force_cast return dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath) as! T } } diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift index a3647c3..d32fa8c 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift @@ -324,4 +324,3 @@ extension SSIDOptionEditTableViewController { } } } - diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift index e4d94d3..e44cf8d 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift @@ -318,7 +318,7 @@ extension TunnelEditTableViewController { let removedSectionIndices = self.deletePeer(peer: peerData) let shouldShowExcludePrivateIPs = (self.tunnelViewModel.peersData.count == 1 && self.tunnelViewModel.peersData[0].shouldAllowExcludePrivateIPsControl) - //swiftlint:disable:next trailing_closure + // swiftlint:disable:next trailing_closure tableView.performBatchUpdates({ self.tableView.deleteSections(removedSectionIndices, with: .fade) if shouldShowExcludePrivateIPs { diff --git a/Sources/WireGuardApp/UI/macOS/Application.swift b/Sources/WireGuardApp/UI/macOS/Application.swift index c45763f..67d67a7 100644 --- a/Sources/WireGuardApp/UI/macOS/Application.swift +++ b/Sources/WireGuardApp/UI/macOS/Application.swift @@ -5,7 +5,7 @@ import Cocoa class Application: NSApplication { - private var appDelegate: AppDelegate? //swiftlint:disable:this weak_delegate + private var appDelegate: AppDelegate? // swiftlint:disable:this weak_delegate override init() { super.init() diff --git a/Sources/WireGuardApp/UI/macOS/NSTableView+Reuse.swift b/Sources/WireGuardApp/UI/macOS/NSTableView+Reuse.swift index 5f2e7dd..bdf55ab 100644 --- a/Sources/WireGuardApp/UI/macOS/NSTableView+Reuse.swift +++ b/Sources/WireGuardApp/UI/macOS/NSTableView+Reuse.swift @@ -7,7 +7,7 @@ extension NSTableView { func dequeueReusableCell() -> T { let identifier = NSUserInterfaceItemIdentifier(NSStringFromClass(T.self)) if let cellView = makeView(withIdentifier: identifier, owner: self) { - //swiftlint:disable:next force_cast + // swiftlint:disable:next force_cast return cellView as! T } let cellView = T() diff --git a/Sources/WireGuardApp/UI/macOS/View/ConfTextStorage.swift b/Sources/WireGuardApp/UI/macOS/View/ConfTextStorage.swift index 7aa1d91..274a137 100644 --- a/Sources/WireGuardApp/UI/macOS/View/ConfTextStorage.swift +++ b/Sources/WireGuardApp/UI/macOS/View/ConfTextStorage.swift @@ -16,7 +16,7 @@ class ConfTextStorage: NSTextStorage { private(set) var hasError = false private(set) var privateKeyString: String? - private(set) var hasOnePeer: Bool = false + private(set) var hasOnePeer = false private(set) var lastOnePeerAllowedIPs = [String]() private(set) var lastOnePeerDNSServers = [String]() private(set) var lastOnePeerHasPublicKey = false diff --git a/Sources/WireGuardApp/UI/macOS/View/ConfTextView.swift b/Sources/WireGuardApp/UI/macOS/View/ConfTextView.swift index bef0885..5d3f3cf 100644 --- a/Sources/WireGuardApp/UI/macOS/View/ConfTextView.swift +++ b/Sources/WireGuardApp/UI/macOS/View/ConfTextView.swift @@ -7,7 +7,7 @@ class ConfTextView: NSTextView { private let confTextStorage = ConfTextStorage() - @objc dynamic var hasError: Bool = false + @objc dynamic var hasError = false @objc dynamic var privateKeyString: String? @objc dynamic var singlePeerAllowedIPs: [String]? -- cgit v1.2.3-59-g8ed1b