Skip to content

Commit 464c27a

Browse files
committed
fix: resolve SwiftLint violations across codebase
1 parent c7ac3bb commit 464c27a

10 files changed

Lines changed: 8 additions & 15 deletions

File tree

TablePro/ContentView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ struct ContentView: View {
396396

397397
storage.deleteConnection(connection)
398398
}
399-
400399
}
401400

402401
#Preview {

TablePro/Core/Plugins/PluginMetadataRegistry.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ final class PluginMetadataRegistry: @unchecked Sendable {
3939
registerBuiltInDefaults()
4040
}
4141

42-
// swiftlint:disable function_body_length
4342
private func registerBuiltInDefaults() {
4443
let defaults: [(typeId: String, snapshot: PluginMetadataSnapshot)] = [
4544
("MySQL", PluginMetadataSnapshot(
@@ -126,7 +125,8 @@ final class PluginMetadataRegistry: @unchecked Sendable {
126125
ExplainVariant(id: "ast", label: "AST", sqlPrefix: "EXPLAIN AST"),
127126
ExplainVariant(id: "syntax", label: "Syntax", sqlPrefix: "EXPLAIN SYNTAX"),
128127
ExplainVariant(id: "estimate", label: "Estimate", sqlPrefix: "EXPLAIN ESTIMATE"),
129-
], pathFieldRole: .database,
128+
],
129+
pathFieldRole: .database,
130130
supportsHealthMonitor: true, urlSchemes: ["clickhouse", "ch"], postConnectActions: [],
131131
brandColorHex: "#FFD100"
132132
)),

TablePro/Core/Plugins/Registry/DownloadCountService.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ final class DownloadCountService {
9696
}
9797
return map
9898
}
99-
10099
}
101100

102101
// MARK: - GitHub API Models

TablePro/Core/SSH/HostKeyStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ internal final class HostKeyStore: @unchecked Sendable {
149149

150150
/// Build the host identifier string: [hostname]:port
151151
private func hostIdentifier(_ hostname: String, _ port: Int) -> String {
152-
return "[\(hostname)]:\(port)"
152+
"[\(hostname)]:\(port)"
153153
}
154154

155155
/// Load all entries from the known_hosts file

TablePro/Core/SSH/LibSSH2TunnelFactory.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ internal enum LibSSH2TunnelFactory {
3131

3232
// MARK: - Public
3333

34-
// swiftlint:disable:next function_body_length
3534
static func createTunnel(
3635
connectionId: UUID,
3736
config: SSHConfiguration,
@@ -185,7 +184,6 @@ internal enum LibSSH2TunnelFactory {
185184
)
186185

187186
return tunnel
188-
189187
} catch {
190188
// Clean up currentSession if it differs from all hop sessions
191189
// (happens when a nextSession was created but failed auth/verify)

TablePro/Core/SSH/SSHTunnelManager.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ actor SSHTunnelManager {
5252

5353
private init() {}
5454

55-
/// Create an SSH tunnel for a database connection
56-
/// - Returns: Local port number for the tunnel
57-
// swiftlint:disable:next function_parameter_count
55+
/// Create an SSH tunnel for a database connection.
5856
func createTunnel(
5957
connectionId: UUID,
6058
sshHost: String,
@@ -129,7 +127,6 @@ actor SSHTunnelManager {
129127

130128
Self.logger.info("Tunnel created for \(connectionId) on local port \(localPort)")
131129
return localPort
132-
133130
} catch let error as SSHTunnelError {
134131
if case .tunnelCreationFailed(let msg) = error,
135132
msg.contains("already in use") {

TablePro/Core/Services/Infrastructure/AppNotifications.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ extension Notification.Name {
1818

1919
static let connectionUpdated = Notification.Name("connectionUpdated")
2020
static let databaseDidConnect = Notification.Name("databaseDidConnect")
21-
2221
}

TablePro/Views/Connection/ConnectionFormView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import SwiftUI
1010
import TableProPluginKit
1111
import UniformTypeIdentifiers
1212

13+
// swiftlint:disable file_length
1314
/// Form for creating or editing a database connection
15+
// swiftlint:disable:next type_body_length
1416
struct ConnectionFormView: View {
1517
private static let logger = Logger(subsystem: "com.TablePro", category: "ConnectionFormView")
1618
@Environment(\.openWindow) private var openWindow

TablePro/Views/Settings/Plugins/BrowsePluginsView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ struct BrowsePluginsView: View {
181181
}
182182

183183
private func formattedCount(_ count: Int) -> String {
184-
if count >= 1000 {
185-
return String(format: "%.1fk", Double(count) / 1000.0)
184+
if count >= 1_000 {
185+
return String(format: "%.1fk", Double(count) / 1_000.0)
186186
}
187187
return "\(count)"
188188
}

TablePro/Views/Sidebar/SidebarView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ struct SidebarView: View {
238238
sidebarState.selectedTables.removeAll()
239239
}
240240
}
241-
242241
}
243242

244243
// MARK: - Preview

0 commit comments

Comments
 (0)