Skip to content

Commit 3739b9c

Browse files
committed
fix: resolve 4 SwiftLint errors for CI
1 parent fc32e29 commit 3739b9c

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

TablePro/AppDelegate.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
136136
self, selector: #selector(handleDatabaseDidConnect),
137137
name: .databaseDidConnect, object: nil
138138
)
139-
140139
}
141140

142141
func applicationDidBecomeActive(_ notification: Notification) {

TablePro/Core/ChangeTracking/DataChangeManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ final class DataChangeManager {
499499

500500
// MARK: - Core Undo Application
501501

502-
// swiftlint:disable:next cyclomatic_complexity function_body_length
502+
// swiftlint:disable:next function_body_length
503503
private func applyDataUndo(_ action: UndoAction) {
504504
switch action {
505505
case .cellEdit(let rowIndex, let columnIndex, let columnName, let previousValue, let newValue):

TablePro/Core/Plugins/PluginError.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ enum PluginError: LocalizedError {
3333
case .incompatibleVersion(let required, let current):
3434
return String(format: String(localized: "Plugin requires PluginKit version %d, but app provides version %d"), required, current)
3535
case .pluginOutdated(let pluginVersion, let requiredVersion):
36-
return String(format: String(localized: "Plugin was built with PluginKit version %d, but version %d is required. Please update the plugin."), pluginVersion, requiredVersion)
36+
let format = String(localized: "Plugin was built with PluginKit version %d, but version %d is required. Please update the plugin.")
37+
return String(format: format, pluginVersion, requiredVersion)
3738
case .cannotUninstallBuiltIn:
3839
return String(localized: "Built-in plugins cannot be uninstalled")
3940
case .notFound:

TablePro/Views/Connection/ConnectionFormView.swift

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,20 +1187,6 @@ struct ConnectionFormView: View {
11871187
}
11881188
}
11891189

1190-
private func cleanupTestSecrets(for testId: UUID) {
1191-
ConnectionStorage.shared.deletePassword(for: testId)
1192-
ConnectionStorage.shared.deleteSSHPassword(for: testId)
1193-
ConnectionStorage.shared.deleteKeyPassphrase(for: testId)
1194-
ConnectionStorage.shared.deleteTOTPSecret(for: testId)
1195-
let secureFieldIds = PluginManager.shared.additionalConnectionFields(for: type)
1196-
.filter(\.isSecure).map(\.id)
1197-
ConnectionStorage.shared.deleteAllPluginSecureFields(for: testId, fieldIds: secureFieldIds)
1198-
}
1199-
1200-
private func loadSSHConfig() {
1201-
sshConfigEntries = SSHConfigParser.parse()
1202-
}
1203-
12041190
private func parseConnectionURL() {
12051191
let trimmed = connectionURL.trimmingCharacters(in: .whitespacesAndNewlines)
12061192
guard !trimmed.isEmpty else {
@@ -1271,6 +1257,24 @@ struct ConnectionFormView: View {
12711257
}
12721258
}
12731259

1260+
// MARK: - Test Helpers
1261+
1262+
private extension ConnectionFormView {
1263+
func cleanupTestSecrets(for testId: UUID) {
1264+
ConnectionStorage.shared.deletePassword(for: testId)
1265+
ConnectionStorage.shared.deleteSSHPassword(for: testId)
1266+
ConnectionStorage.shared.deleteKeyPassphrase(for: testId)
1267+
ConnectionStorage.shared.deleteTOTPSecret(for: testId)
1268+
let secureFieldIds = PluginManager.shared.additionalConnectionFields(for: type)
1269+
.filter(\.isSecure).map(\.id)
1270+
ConnectionStorage.shared.deleteAllPluginSecureFields(for: testId, fieldIds: secureFieldIds)
1271+
}
1272+
1273+
func loadSSHConfig() {
1274+
sshConfigEntries = SSHConfigParser.parse()
1275+
}
1276+
}
1277+
12741278
// MARK: - SSH Agent Helpers
12751279

12761280
extension ConnectionFormView {

0 commit comments

Comments
 (0)