]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
build: Fix swiftlint warnings
authorRoopesh Chander <roop@roopc.net>
Mon, 2 Aug 2021 08:19:47 +0000 (13:49 +0530)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 22 Sep 2021 04:58:14 +0000 (06:58 +0200)
Signed-off-by: Roopesh Chander <roop@roopc.net>
Sources/WireGuardApp/Tunnel/TunnelsManager.swift
Sources/WireGuardApp/UI/iOS/UITableViewCell+Reuse.swift
Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift
Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift
Sources/WireGuardApp/UI/macOS/Application.swift
Sources/WireGuardApp/UI/macOS/NSTableView+Reuse.swift
Sources/WireGuardApp/UI/macOS/View/ConfTextStorage.swift
Sources/WireGuardApp/UI/macOS/View/ConfTextView.swift

index fe3955bd6e03ecbeee46b42ce71cd529e5386d95..83c48c9bd2bf726b651d19f7d90daf270ea4a7b3 100644 (file)
@@ -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
index fbe56a11c278c0c3cddcb27d9d4f013c97e07839..dc981d2d2d3ba910849ef30d967a8a120ad41ed0 100644 (file)
@@ -15,7 +15,7 @@ extension UITableView {
     }
 
     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
     }
 }
index e4d94d3ee78ca6e36e0f518f92b01f826935ab01..e44cf8d4c6505adf475e7d76fd3990ddb75666f9 100644 (file)
@@ -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 {
index c45763f5edf40bd93cae5b9f479ee2c1d8d6f3e2..67d67a7958db7e17e5d18bdd45938b3e39ebb7d0 100644 (file)
@@ -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()
index 5f2e7ddf1ee2cc162ee717bce803106affd2d45f..bdf55ab9a3caa36af41e8bf57758b79432136a8e 100644 (file)
@@ -7,7 +7,7 @@ extension NSTableView {
     func dequeueReusableCell<T: NSView>() -> 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()
index 7aa1d91d8fb4502ba61d870e2cf30bf7d8dd12bd..274a1370db2662a988012fdf3b57b7d8f19569f9 100644 (file)
@@ -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
index bef088507fb23842758c776849e4be6cdb1d4ea4..5d3f3cf5b2a78c9568799c038c1ae442a94dad40 100644 (file)
@@ -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]?