fix(ci): format macOS Swift sources

This commit is contained in:
Peter Steinberger
2026-05-17 01:35:14 +01:00
parent f0513221d7
commit e98ebb5739
4 changed files with 30 additions and 14 deletions

View File

@@ -380,10 +380,10 @@ final class AppState {
{
self.remoteTarget = configRemoteTarget
} else if resolvedConnectionMode == .remote,
configRemoteTransport != .direct,
storedRemoteTarget.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
let host = AppState.remoteHost(from: configRemoteUrl),
!LoopbackHost.isLoopbackHost(host)
configRemoteTransport != .direct,
storedRemoteTarget.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
let host = AppState.remoteHost(from: configRemoteUrl),
!LoopbackHost.isLoopbackHost(host)
{
self.remoteTarget = "\(NSUserName())@\(host)"
} else {

View File

@@ -3,11 +3,15 @@ import Foundation
import WebKit
private final class DashboardWindowContentView: NSView {
override var mouseDownCanMoveWindow: Bool { true }
override var mouseDownCanMoveWindow: Bool {
true
}
}
private final class DashboardWindowDragRegionView: NSView {
override var mouseDownCanMoveWindow: Bool { true }
override var mouseDownCanMoveWindow: Bool {
true
}
override func mouseDown(with event: NSEvent) {
self.window?.performDrag(with: event)
@@ -275,7 +279,7 @@ final class DashboardWindowController: NSWindowController, WKNavigationDelegate,
private func showLoadFailure(_ error: Error) {
let nsError = error as NSError
if nsError.domain == NSURLErrorDomain && nsError.code == NSURLErrorCancelled { return }
if nsError.domain == NSURLErrorDomain, nsError.code == NSURLErrorCancelled { return }
dashboardWindowLogger.error(
"dashboard load failed url=\(self.currentURL.absoluteString, privacy: .public) error=\(error.localizedDescription, privacy: .public)")
let html = Self.failureHTML(url: self.currentURL, message: error.localizedDescription)
@@ -324,8 +328,8 @@ final class DashboardWindowController: NSWindowController, WKNavigationDelegate,
<body>
<main>
<h1>Dashboard unavailable</h1>
<p>\(Self.htmlEscape(message))</p>
<code>\(Self.htmlEscape(url.absoluteString))</code>
<p>\(self.htmlEscape(message))</p>
<code>\(self.htmlEscape(url.absoluteString))</code>
</main>
</body>
</html>

View File

@@ -55,7 +55,10 @@ actor RemoteTunnelManager {
if let create = self.createInFlight {
self.logger.info("control tunnel create in flight; joining")
let tunnel = try await create.task.value
return try await self.installCreatedTunnel(tunnel, token: create.token, fallbackPort: UInt16(GatewayEnvironment.gatewayPort()))
return try await self.installCreatedTunnel(
tunnel,
token: create.token,
fallbackPort: UInt16(GatewayEnvironment.gatewayPort()))
}
await self.waitForRestartBackoffIfNeeded()
@@ -80,7 +83,11 @@ actor RemoteTunnelManager {
return try await self.installCreatedTunnel(tunnel, token: token, fallbackPort: desiredPort)
}
private func installCreatedTunnel(_ tunnel: RemotePortTunnel, token: UUID, fallbackPort: UInt16) async throws -> UInt16 {
private func installCreatedTunnel(
_ tunnel: RemotePortTunnel,
token: UUID,
fallbackPort: UInt16) async throws -> UInt16
{
if self.createInFlight?.token == token {
self.createInFlight = nil
}

View File

@@ -161,12 +161,17 @@ private func configureSSHRemote(_ opts: ConfigureRemoteOptions) throws -> Config
onboardingSkipped: true)
}
private func configureDirectRemote(_ opts: ConfigureRemoteOptions, directUrlRaw: String) throws -> ConfigureRemoteOutput {
private func configureDirectRemote(
_ opts: ConfigureRemoteOptions,
directUrlRaw: String) throws -> ConfigureRemoteOutput
{
guard let directURL = normalizeDirectURL(directUrlRaw) else {
throw NSError(
domain: "ConfigureRemote",
code: 2,
userInfo: [NSLocalizedDescriptionKey: "Direct URL must be ws:// for private/Tailscale hosts or wss:// for remote hosts"])
userInfo: [
NSLocalizedDescriptionKey: "Direct URL must be ws:// for private/Tailscale hosts or wss:// for remote hosts",
])
}
let configURL = openClawConfigURL()
@@ -212,7 +217,7 @@ private func openClawConfigURL() -> URL {
private func loadConfigRoot(from url: URL) throws -> [String: Any] {
guard FileManager().isReadableFile(atPath: url.path) else { return [:] }
let data = try Data(contentsOf: url)
return (try JSONSerialization.jsonObject(with: data) as? [String: Any]) ?? [:]
return try (JSONSerialization.jsonObject(with: data) as? [String: Any]) ?? [:]
}
private func saveConfigRoot(_ root: [String: Any], to url: URL) throws {