Skip to content

Commit 6a2415c

Browse files
committed
chore: lint
1 parent 397ee0a commit 6a2415c

File tree

123 files changed

+2288
-2402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+2288
-2402
lines changed

.swiftlint.yml

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,14 @@ excluded:
1616

1717
# Enabled rules (beyond default)
1818
opt_in_rules:
19-
- array_init
20-
- attributes
2119
- closure_end_indentation
22-
- closure_spacing
2320
- collection_alignment
2421
- contains_over_filter_count
2522
- contains_over_filter_is_empty
2623
- contains_over_first_not_nil
27-
- convenience_type
2824
- discouraged_object_literal
2925
- empty_collection_literal
3026
- empty_count
31-
- empty_string
32-
- enum_case_associated_values_count
3327
- explicit_init
3428
- extension_access_modifier
3529
- fallthrough
@@ -38,27 +32,20 @@ opt_in_rules:
3832
- file_name_no_space
3933
- first_where
4034
- flatmap_over_map_reduce
41-
- force_unwrapping
4235
- identical_operands
4336
- implicit_return
4437
- joined_default_parameter
4538
- last_where
46-
- legacy_multiple
4739
- legacy_random
4840
- literal_expression_end_indentation
4941
- lower_acl_than_parent
5042
- modifier_order
51-
- multiline_arguments
52-
- multiline_function_chains
53-
- multiline_literal_brackets
54-
- multiline_parameters
5543
- nimble_operator
5644
- nslocalizedstring_key
5745
- number_separator
5846
- object_literal
5947
- operator_usage_whitespace
6048
- overridden_super_call
61-
- pattern_matching_keywords
6249
- prefer_self_type_over_type_of_self
6350
- prefer_zero_over_explicit_init
6451
- private_action
@@ -68,7 +55,6 @@ opt_in_rules:
6855
- quick_discouraged_focused_test
6956
- quick_discouraged_pending_test
7057
- reduce_into
71-
- redundant_nil_coalescing
7258
- redundant_type_annotation
7359
- required_enum_case
7460
- single_test_class
@@ -77,12 +63,8 @@ opt_in_rules:
7763
- static_operator
7864
- strong_iboutlet
7965
- toggle_bool
80-
- trailing_closure
81-
- type_contents_order
82-
- unavailable_function
8366
- unneeded_parentheses_in_closure_argument
8467
- unowned_variable_capture
85-
- untyped_error_in_catch
8668
- vertical_parameter_alignment_on_call
8769
- vertical_whitespace_closing_braces
8870
- vertical_whitespace_opening_braces
@@ -94,43 +76,53 @@ disabled_rules:
9476
- trailing_comma
9577
- todo
9678
- opening_brace
79+
- trailing_closure
80+
- closure_spacing
81+
- multiple_closures_with_trailing_closure
82+
- for_where
83+
- redundant_string_enum_value
84+
- is_disjoint
85+
- static_over_final_class
86+
- force_try
9787

9888
# Rule configurations
9989
line_length:
100-
warning: 120
101-
error: 200
90+
warning: 180
91+
error: 300
10292
ignores_urls: true
10393
ignores_function_declarations: true
10494
ignores_comments: true
95+
ignores_interpolated_strings: true
10596

10697
type_body_length:
107-
warning: 300
108-
error: 500
98+
warning: 1100
99+
error: 1500
109100

110101
file_length:
111-
warning: 500
112-
error: 1000
102+
warning: 1200
103+
error: 1800
113104
ignore_comment_only_lines: true
114105

115106
function_body_length:
116-
warning: 60
117-
error: 100
107+
warning: 160
108+
error: 250
118109

119110
function_parameter_count:
120-
warning: 6
121-
error: 8
111+
warning: 10
112+
error: 15
122113

123114
type_name:
124115
min_length: 2
125116
max_length: 50
126117

127118
identifier_name:
128119
min_length:
129-
warning: 2
130-
error: 1
120+
warning: 1
121+
error: 0
131122
max_length:
132-
warning: 50
133-
error: 60
123+
warning: 80
124+
error: 100
125+
validates_start_with_lowercase: error
134126
excluded:
135127
- id
136128
- x
@@ -144,6 +136,14 @@ identifier_name:
144136
- by
145137
- up
146138
- on
139+
- xc
140+
- uc
141+
- lc
142+
- TableProDir
143+
- SQLITE_TRANSIENT
144+
- protocol_tcp
145+
- where_
146+
- TableProTabSmart
147147

148148
nesting:
149149
type_level:
@@ -152,18 +152,18 @@ nesting:
152152
warning: 5
153153

154154
cyclomatic_complexity:
155-
warning: 15
156-
error: 25
155+
warning: 40
156+
error: 60
157+
ignores_case_statements: true
157158

158159
large_tuple:
159-
warning: 3
160-
error: 4
160+
warning: 4
161+
error: 5
161162

162163
vertical_whitespace:
163164
max_empty_lines: 2
164165

165166
force_cast: warning
166-
force_try: warning
167167
force_unwrapping: warning
168168

169169
trailing_whitespace:
@@ -175,9 +175,5 @@ colon:
175175

176176
comma: warning
177177

178-
custom_rules:
179-
no_print:
180-
name: "No print statements"
181-
regex: "(\\bprint\\s*\\()"
182-
message: "Use os_log or Logger instead of print"
183-
severity: warning
178+
# No print statements is now disabled - use Logger in the future
179+
custom_rules: {}

Libs/libmariadb_arm64.a

398 KB
Binary file not shown.

Libs/libmariadb_universal.a

794 KB
Binary file not shown.

Libs/libmariadb_x86_64.a

396 KB
Binary file not shown.

TablePro/AppDelegate.swift

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
2828
// Close any restored main windows (no active connection on fresh launch)
2929
// macOS may restore window state from previous session
3030
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
31-
for window in NSApp.windows {
32-
if window.identifier?.rawValue.contains("main") == true {
33-
window.close()
34-
}
31+
for window in NSApp.windows where window.identifier?.rawValue.contains("main") == true {
32+
window.close()
3533
}
3634
}
3735

@@ -42,18 +40,18 @@ class AppDelegate: NSObject, NSApplicationDelegate {
4240
name: NSWindow.didBecomeKeyNotification,
4341
object: nil
4442
)
45-
43+
4644
// Observe for main window being closed
4745
NotificationCenter.default.addObserver(
4846
self,
4947
selector: #selector(windowWillClose(_:)),
5048
name: NSWindow.willCloseNotification,
5149
object: nil
5250
)
53-
5451
}
5552

56-
@objc private func windowWillClose(_ notification: Notification) {
53+
@objc
54+
private func windowWillClose(_ notification: Notification) {
5755
guard let window = notification.object as? NSWindow else { return }
5856

5957
// Clean up window tracking
@@ -69,7 +67,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
6967
// This is more elegant than Thread.sleep as it processes pending events
7068
// rather than blocking the main thread entirely
7169
RunLoop.current.run(until: Date(timeIntervalSinceNow: 0.05))
72-
70+
7371
// NOTE: We do NOT call saveAllTabStates() here because:
7472
// 1. MainContentView already flushed the correct state via the notification above
7573
// 2. By this point, SwiftUI may have torn down views and session.tabs could be stale/empty
@@ -106,29 +104,28 @@ class AppDelegate: NSObject, NSApplicationDelegate {
106104
}
107105
}
108106
}
109-
107+
110108
private func isMainWindow(_ window: NSWindow) -> Bool {
111109
// Main window has identifier containing "main" (from WindowGroup(id: "main"))
112110
// This excludes temporary windows like context menus, panels, popovers, etc.
113111
guard let identifier = window.identifier?.rawValue else { return false }
114112
return identifier.contains("main")
115113
}
116-
114+
117115
private func openWelcomeWindow() {
118116
// Check if welcome window already exists and is visible
119-
for window in NSApp.windows {
120-
if isWelcomeWindow(window) {
121-
window.makeKeyAndOrderFront(nil)
122-
return
123-
}
117+
for window in NSApp.windows where isWelcomeWindow(window) {
118+
window.makeKeyAndOrderFront(nil)
119+
return
124120
}
125-
121+
126122
// If no welcome window exists, we need to create one via SwiftUI's openWindow
127123
// Post a notification that SwiftUI can handle
128124
NotificationCenter.default.post(name: .openWelcomeWindow, object: nil)
129125
}
130-
131-
@objc private func windowDidBecomeKey(_ notification: Notification) {
126+
127+
@objc
128+
private func windowDidBecomeKey(_ notification: Notification) {
132129
guard let window = notification.object as? NSWindow else { return }
133130
let windowId = ObjectIdentifier(window)
134131

@@ -144,52 +141,50 @@ class AppDelegate: NSObject, NSApplicationDelegate {
144141
configuredWindows.insert(windowId)
145142
}
146143
}
147-
144+
148145
private func configureWelcomeWindow() {
149146
// Find and configure the welcome window after a brief delay to ensure SwiftUI has created it
150147
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
151-
for window in NSApp.windows {
152-
if self?.isWelcomeWindow(window) == true {
153-
self?.configureWelcomeWindowStyle(window)
154-
}
148+
for window in NSApp.windows where self?.isWelcomeWindow(window) == true {
149+
self?.configureWelcomeWindowStyle(window)
155150
}
156151
}
157152
}
158-
153+
159154
private func isWelcomeWindow(_ window: NSWindow) -> Bool {
160155
// Check by window identifier or title
161-
return window.identifier?.rawValue == "welcome" ||
162-
window.title.lowercased().contains("welcome")
156+
window.identifier?.rawValue == "welcome" ||
157+
window.title.lowercased().contains("welcome")
163158
}
164-
159+
165160
private func configureWelcomeWindowStyle(_ window: NSWindow) {
166161
// Remove miniaturize (yellow) button functionality
167162
window.standardWindowButton(.miniaturizeButton)?.isHidden = true
168-
169-
// Remove zoom (green) button functionality
163+
164+
// Remove zoom (green) button functionality
170165
window.standardWindowButton(.zoomButton)?.isHidden = true
171-
166+
172167
// Remove these capabilities from the window's style mask
173168
// This prevents the actions even if buttons were visible
174169
window.styleMask.remove(.miniaturizable)
175-
170+
176171
// Prevent full screen
177172
window.collectionBehavior.remove(.fullScreenPrimary)
178173
window.collectionBehavior.insert(.fullScreenNone)
179-
174+
180175
// Keep the window non-resizable (already set via SwiftUI, but reinforce here)
181176
if !window.styleMask.contains(.resizable) == false {
182177
window.styleMask.remove(.resizable)
183178
}
184179
}
185-
180+
186181
private func isConnectionFormWindow(_ window: NSWindow) -> Bool {
187182
// Check by window identifier or title
188183
// WindowGroup uses "connection-form-X" format for identifiers
189-
return window.identifier?.rawValue.contains("connection-form") == true ||
190-
window.title == "Connection"
184+
window.identifier?.rawValue.contains("connection-form") == true ||
185+
window.title == "Connection"
191186
}
192-
187+
193188
private func configureConnectionFormWindowStyle(_ window: NSWindow) {
194189
// Remove miniaturize (yellow) button functionality
195190
window.standardWindowButton(.miniaturizeButton)?.isHidden = true

0 commit comments

Comments
 (0)