Skip to content

Commit 088ab06

Browse files
committed
lint & fmt
1 parent 22253d6 commit 088ab06

14 files changed

+29
-28
lines changed

Coder Desktop/Coder Desktop/Theme.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ enum Theme {
88

99
static let rectCornerRadius: CGFloat = 4
1010
}
11+
1112
static let defaultVisibleAgents = 5
1213
}

Coder Desktop/Coder Desktop/Views/Agents.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ struct Agents<VPN: VPNService, S: Session>: View {
66
@State private var viewAll = false
77
private let defaultVisibleRows = 5
88

9-
internal let inspection = Inspection<Self>()
9+
let inspection = Inspection<Self>()
1010

1111
var body: some View {
1212
Group {

Coder Desktop/Coder Desktop/Views/LoginForm.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct LoginForm<C: Client, S: Session>: View {
1111
@State private var loading: Bool = false
1212
@FocusState private var focusedField: LoginField?
1313

14-
internal let inspection = Inspection<Self>()
14+
let inspection = Inspection<Self>()
1515

1616
var body: some View {
1717
VStack {
@@ -56,7 +56,7 @@ struct LoginForm<C: Client, S: Session>: View {
5656
.onReceive(inspection.notice) { self.inspection.visit(self, $0) } // ViewInspector
5757
}
5858

59-
internal func submit() async {
59+
func submit() async {
6060
loginError = nil
6161
guard sessionToken != "" else {
6262
loginError = .invalidToken
@@ -67,7 +67,7 @@ struct LoginForm<C: Client, S: Session>: View {
6767
return
6868
}
6969
loading = true
70-
defer { loading = false}
70+
defer { loading = false }
7171
let client = C(url: url, token: sessionToken)
7272
do {
7373
_ = try await client.user("me")
@@ -135,8 +135,8 @@ struct LoginForm<C: Client, S: Session>: View {
135135
Button("Sign In") {
136136
Task { await submit() }
137137
}
138-
.buttonStyle(.borderedProminent)
139-
.keyboardShortcut(.defaultAction)
138+
.buttonStyle(.borderedProminent)
139+
.keyboardShortcut(.defaultAction)
140140
}.padding(.top, 5)
141141
}
142142
}

Coder Desktop/Coder Desktop/Views/Util.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Combine
22

33
// This is required for inspecting stateful views
4-
internal final class Inspection<V> {
4+
final class Inspection<V> {
55
let notice = PassthroughSubject<UInt, Never>()
66
var callbacks = [UInt: (V) -> Void]()
77

Coder Desktop/Coder Desktop/Views/VPNMenu.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ struct VPNMenu<VPN: VPNService, S: Session>: View {
44
@EnvironmentObject var vpn: VPN
55
@EnvironmentObject var session: S
66

7-
internal let inspection = Inspection<Self>()
7+
let inspection = Inspection<Self>()
88

99
var body: some View {
1010
// Main stack

Coder Desktop/Coder Desktop/Views/VPNState.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SwiftUI
33
struct VPNState<VPN: VPNService>: View {
44
@EnvironmentObject var vpn: VPN
55

6-
internal let inspection = Inspection<Self>()
6+
let inspection = Inspection<Self>()
77

88
var body: some View {
99
Group {

Coder Desktop/Coder DesktopTests/AgentsTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testable import Coder_Desktop
2+
import SwiftUI
23
import Testing
34
import ViewInspector
4-
import SwiftUI
55

66
@Suite(.timeLimit(.minutes(1)))
77
struct AgentsTests {
@@ -47,7 +47,7 @@ struct AgentsTests {
4747

4848
let forEach = try view.inspect().find(ViewType.ForEach.self)
4949
#expect(forEach.count == Theme.defaultVisibleAgents)
50-
#expect(throws: Never.self) { try view.inspect().find(link: "a1.coder")}
50+
#expect(throws: Never.self) { try view.inspect().find(link: "a1.coder") }
5151
}
5252

5353
@Test

Coder Desktop/Coder DesktopTests/LoginFormTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testable import Coder_Desktop
2-
import ViewInspector
3-
import Testing
42
import SwiftUI
3+
import Testing
4+
import ViewInspector
55

66
@Suite(.timeLimit(.minutes(1)))
77
struct LoginTests {

Coder Desktop/Coder DesktopTests/Util.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ struct MockClient: Client {
6767
}
6868

6969
struct MockErrorClient: Client {
70-
init(url: URL, token: String?) {}
71-
func user(_ ident: String) async throws -> Coder_Desktop.User {
70+
init(url _: URL, token _: String?) {}
71+
func user(_: String) async throws -> Coder_Desktop.User {
7272
throw ClientError.badResponse
7373
}
7474
}
7575

76-
extension Inspection: @retroactive InspectionEmissary { }
76+
extension Inspection: @retroactive InspectionEmissary {}

Coder Desktop/Coder DesktopTests/VPNMenuTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testable import Coder_Desktop
2+
import SwiftUI
23
import Testing
34
import ViewInspector
4-
import SwiftUI
55

66
@Suite(.timeLimit(.minutes(1)))
77
struct VPNMenuTests {

Coder Desktop/Coder DesktopTests/VPNStateTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testable import Coder_Desktop
2-
import ViewInspector
3-
import Testing
42
import SwiftUI
3+
import Testing
4+
import ViewInspector
55

66
@Suite(.timeLimit(.minutes(1)))
77
struct VPNStateTests {

Coder Desktop/Coder DesktopUITests/Coder_DesktopUITests.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ final class Coder_DesktopUITests: XCTestCase {
77
// In UI tests it is usually best to stop immediately when a failure occurs.
88
continueAfterFailure = false
99

10-
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
10+
// In UI tests it’s important to set the initial state - such as
11+
// interface orientation - required for your tests before they run. The setUp method is a good place to do this.
1112
}
1213

1314
override func tearDownWithError() throws {

Coder Desktop/Coder DesktopUITests/Coder_DesktopUITestsLaunchTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import XCTest
22

33
final class Coder_DesktopUITestsLaunchTests: XCTestCase {
4-
override class var runsForEachTargetApplicationUIConfiguration: Bool {
4+
override static var runsForEachTargetApplicationUIConfiguration: Bool {
55
true
66
}
77

Coder Desktop/VPN/PacketTunnelProvider.swift

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
import NetworkExtension
22

33
class PacketTunnelProvider: NEPacketTunnelProvider {
4-
5-
override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) {
4+
override func startTunnel(options _: [String: NSObject]?, completionHandler _: @escaping (Error?) -> Void) {
65
// Add code here to start the process of connecting the tunnel.
76
}
8-
9-
override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) {
7+
8+
override func stopTunnel(with _: NEProviderStopReason, completionHandler: @escaping () -> Void) {
109
// Add code here to start the process of stopping the tunnel.
1110
completionHandler()
1211
}
13-
12+
1413
override func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)?) {
1514
// Add code here to handle the message.
1615
if let handler = completionHandler {
1716
handler(messageData)
1817
}
1918
}
20-
19+
2120
override func sleep(completionHandler: @escaping () -> Void) {
2221
// Add code here to get ready to sleep.
2322
completionHandler()
2423
}
25-
24+
2625
override func wake() {
2726
// Add code here to wake up.
2827
}

0 commit comments

Comments
 (0)