Skip to content

Commit e98ebb5

Browse files
committed
fix(ci): format macOS Swift sources
1 parent f051322 commit e98ebb5

4 files changed

Lines changed: 30 additions & 14 deletions

File tree

apps/macos/Sources/OpenClaw/AppState.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,10 @@ final class AppState {
380380
{
381381
self.remoteTarget = configRemoteTarget
382382
} else if resolvedConnectionMode == .remote,
383-
configRemoteTransport != .direct,
384-
storedRemoteTarget.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
385-
let host = AppState.remoteHost(from: configRemoteUrl),
386-
!LoopbackHost.isLoopbackHost(host)
383+
configRemoteTransport != .direct,
384+
storedRemoteTarget.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
385+
let host = AppState.remoteHost(from: configRemoteUrl),
386+
!LoopbackHost.isLoopbackHost(host)
387387
{
388388
self.remoteTarget = "\(NSUserName())@\(host)"
389389
} else {

apps/macos/Sources/OpenClaw/DashboardWindowController.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ import Foundation
33
import WebKit
44

55
private final class DashboardWindowContentView: NSView {
6-
override var mouseDownCanMoveWindow: Bool { true }
6+
override var mouseDownCanMoveWindow: Bool {
7+
true
8+
}
79
}
810

911
private final class DashboardWindowDragRegionView: NSView {
10-
override var mouseDownCanMoveWindow: Bool { true }
12+
override var mouseDownCanMoveWindow: Bool {
13+
true
14+
}
1115

1216
override func mouseDown(with event: NSEvent) {
1317
self.window?.performDrag(with: event)
@@ -275,7 +279,7 @@ final class DashboardWindowController: NSWindowController, WKNavigationDelegate,
275279

276280
private func showLoadFailure(_ error: Error) {
277281
let nsError = error as NSError
278-
if nsError.domain == NSURLErrorDomain && nsError.code == NSURLErrorCancelled { return }
282+
if nsError.domain == NSURLErrorDomain, nsError.code == NSURLErrorCancelled { return }
279283
dashboardWindowLogger.error(
280284
"dashboard load failed url=\(self.currentURL.absoluteString, privacy: .public) error=\(error.localizedDescription, privacy: .public)")
281285
let html = Self.failureHTML(url: self.currentURL, message: error.localizedDescription)
@@ -324,8 +328,8 @@ final class DashboardWindowController: NSWindowController, WKNavigationDelegate,
324328
<body>
325329
<main>
326330
<h1>Dashboard unavailable</h1>
327-
<p>\(Self.htmlEscape(message))</p>
328-
<code>\(Self.htmlEscape(url.absoluteString))</code>
331+
<p>\(self.htmlEscape(message))</p>
332+
<code>\(self.htmlEscape(url.absoluteString))</code>
329333
</main>
330334
</body>
331335
</html>

apps/macos/Sources/OpenClaw/RemoteTunnelManager.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ actor RemoteTunnelManager {
5555
if let create = self.createInFlight {
5656
self.logger.info("control tunnel create in flight; joining")
5757
let tunnel = try await create.task.value
58-
return try await self.installCreatedTunnel(tunnel, token: create.token, fallbackPort: UInt16(GatewayEnvironment.gatewayPort()))
58+
return try await self.installCreatedTunnel(
59+
tunnel,
60+
token: create.token,
61+
fallbackPort: UInt16(GatewayEnvironment.gatewayPort()))
5962
}
6063
await self.waitForRestartBackoffIfNeeded()
6164

@@ -80,7 +83,11 @@ actor RemoteTunnelManager {
8083
return try await self.installCreatedTunnel(tunnel, token: token, fallbackPort: desiredPort)
8184
}
8285

83-
private func installCreatedTunnel(_ tunnel: RemotePortTunnel, token: UUID, fallbackPort: UInt16) async throws -> UInt16 {
86+
private func installCreatedTunnel(
87+
_ tunnel: RemotePortTunnel,
88+
token: UUID,
89+
fallbackPort: UInt16) async throws -> UInt16
90+
{
8491
if self.createInFlight?.token == token {
8592
self.createInFlight = nil
8693
}

apps/macos/Sources/OpenClawMacCLI/ConfigureRemoteCommand.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,17 @@ private func configureSSHRemote(_ opts: ConfigureRemoteOptions) throws -> Config
161161
onboardingSkipped: true)
162162
}
163163

164-
private func configureDirectRemote(_ opts: ConfigureRemoteOptions, directUrlRaw: String) throws -> ConfigureRemoteOutput {
164+
private func configureDirectRemote(
165+
_ opts: ConfigureRemoteOptions,
166+
directUrlRaw: String) throws -> ConfigureRemoteOutput
167+
{
165168
guard let directURL = normalizeDirectURL(directUrlRaw) else {
166169
throw NSError(
167170
domain: "ConfigureRemote",
168171
code: 2,
169-
userInfo: [NSLocalizedDescriptionKey: "Direct URL must be ws:// for private/Tailscale hosts or wss:// for remote hosts"])
172+
userInfo: [
173+
NSLocalizedDescriptionKey: "Direct URL must be ws:// for private/Tailscale hosts or wss:// for remote hosts",
174+
])
170175
}
171176

172177
let configURL = openClawConfigURL()
@@ -212,7 +217,7 @@ private func openClawConfigURL() -> URL {
212217
private func loadConfigRoot(from url: URL) throws -> [String: Any] {
213218
guard FileManager().isReadableFile(atPath: url.path) else { return [:] }
214219
let data = try Data(contentsOf: url)
215-
return (try JSONSerialization.jsonObject(with: data) as? [String: Any]) ?? [:]
220+
return try (JSONSerialization.jsonObject(with: data) as? [String: Any]) ?? [:]
216221
}
217222

218223
private func saveConfigRoot(_ root: [String: Any], to url: URL) throws {

0 commit comments

Comments
 (0)