Enabled more swiftlint rules
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
This commit is contained in:
@@ -42,7 +42,7 @@ class WgQuickConfigFileParser {
|
||||
|
||||
trimmedLine = trimmedLine.trimmingCharacters(in: .whitespaces)
|
||||
|
||||
guard trimmedLine.count > 0 else { continue }
|
||||
guard !trimmedLine.isEmpty else { continue }
|
||||
let lowercasedLine = line.lowercased()
|
||||
|
||||
if let equalsIndex = line.firstIndex(of: "=") {
|
||||
|
||||
@@ -52,6 +52,7 @@ enum TunnelsManagerActivationAttemptError: WireGuardAppError {
|
||||
enum TunnelsManagerActivationError: WireGuardAppError {
|
||||
case activationFailed
|
||||
case activationFailedWithExtensionError(title: String, message: String)
|
||||
|
||||
var alertText: AlertText {
|
||||
switch self {
|
||||
case .activationFailed:
|
||||
|
||||
@@ -361,7 +361,7 @@ class TunnelViewModel {
|
||||
var peersData: [PeerData]
|
||||
|
||||
init(tunnelConfiguration: TunnelConfiguration?) {
|
||||
let interfaceData: InterfaceData = InterfaceData()
|
||||
let interfaceData = InterfaceData()
|
||||
var peersData = [PeerData]()
|
||||
if let tunnelConfiguration = tunnelConfiguration {
|
||||
interfaceData.validatedConfiguration = tunnelConfiguration.interface
|
||||
|
||||
@@ -33,7 +33,7 @@ class ButtonCell: UITableViewCell {
|
||||
button.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor),
|
||||
contentView.layoutMarginsGuide.bottomAnchor.constraint(equalTo: button.bottomAnchor),
|
||||
button.centerXAnchor.constraint(equalTo: contentView.centerXAnchor)
|
||||
])
|
||||
])
|
||||
|
||||
button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
|
||||
}
|
||||
|
||||
@@ -76,15 +76,11 @@ class QRScanViewController: UIViewController {
|
||||
super.viewDidLayoutSubviews()
|
||||
|
||||
if let connection = previewLayer?.connection {
|
||||
|
||||
let currentDevice: UIDevice = UIDevice.current
|
||||
|
||||
let orientation: UIDeviceOrientation = currentDevice.orientation
|
||||
|
||||
let previewLayerConnection: AVCaptureConnection = connection
|
||||
let currentDevice = UIDevice.current
|
||||
let orientation = currentDevice.orientation
|
||||
let previewLayerConnection = connection
|
||||
|
||||
if previewLayerConnection.isVideoOrientationSupported {
|
||||
|
||||
switch orientation {
|
||||
case .portrait:
|
||||
previewLayerConnection.videoOrientation = .portrait
|
||||
|
||||
@@ -127,7 +127,7 @@ class TunnelsListTableViewController: UIViewController {
|
||||
present(alert, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
@objc func settingsButtonTapped(sender: UIBarButtonItem!) {
|
||||
@objc func settingsButtonTapped(sender: UIBarButtonItem) {
|
||||
guard tunnelsManager != nil else { return }
|
||||
|
||||
let settingsVC = SettingsTableViewController(tunnelsManager: tunnelsManager)
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
|
||||
protocol WireGuardAppError: Error {
|
||||
typealias AlertText = (title: String, message: String)
|
||||
|
||||
var alertText: AlertText { get }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user