Skip to content

Commit ddb9657

Browse files
committed
fix(swift-gui): convert inline comments to doc comments for SwiftFormat compliance
Fixes CI failure by converting // comments to /// doc comments on function declarations within test methods, satisfying the docComments rule.
1 parent fd9356e commit ddb9657

12 files changed

+58
-58
lines changed

swift-gui/ARMEmulatorTests/Views/AboutViewTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ final class BackendVersionTests: XCTestCase {
5959

6060
final class CommitHashFormattingTests: XCTestCase {
6161
func testFormatCommitHash() {
62-
// Simulate the formatCommitHash() method
62+
/// Simulate the formatCommitHash() method
6363
func formatCommitHash(_ hash: String) -> String {
6464
if hash == "unknown" {
6565
return hash
@@ -97,7 +97,7 @@ final class CommitHashFormattingTests: XCTestCase {
9797

9898
final class DateFormattingTests: XCTestCase {
9999
func testFormatDate() {
100-
// Simulate the formatDate() method
100+
/// Simulate the formatDate() method
101101
func formatDate(_ dateString: String) -> String {
102102
if dateString == "unknown" {
103103
return dateString
@@ -282,7 +282,7 @@ final class AboutViewTextTests: XCTestCase {
282282
}
283283

284284
func testVersionDisplayFormat() {
285-
// Test version display format
285+
/// Test version display format
286286
func formatVersionDisplay(version: BackendVersion) -> [String] {
287287
[
288288
"Backend Version: \(version.version)",

swift-gui/ARMEmulatorTests/Views/BackendStatusViewTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class BackendStatusViewStateTests: XCTestCase {
1818
}
1919

2020
func testErrorMessageExtraction() {
21-
// Test extracting error message from BackendStatus.error case
21+
/// Test extracting error message from BackendStatus.error case
2222
func extractErrorMessage(from status: BackendManager.BackendStatus) -> String? {
2323
if case let .error(message) = status {
2424
return message
@@ -33,7 +33,7 @@ final class BackendStatusViewStateTests: XCTestCase {
3333
}
3434

3535
func testStatusRequiresRetryButton() {
36-
// Determine which statuses should show a retry/start button
36+
/// Determine which statuses should show a retry/start button
3737
func shouldShowRetryButton(for status: BackendManager.BackendStatus) -> Bool {
3838
switch status {
3939
case .stopped, .error:
@@ -51,7 +51,7 @@ final class BackendStatusViewStateTests: XCTestCase {
5151
}
5252

5353
func testStatusShowsProgressIndicator() {
54-
// Determine which statuses should show a progress indicator
54+
/// Determine which statuses should show a progress indicator
5555
func shouldShowProgress(for status: BackendManager.BackendStatus) -> Bool {
5656
switch status {
5757
case .unknown, .starting:
@@ -69,7 +69,7 @@ final class BackendStatusViewStateTests: XCTestCase {
6969
}
7070

7171
func testStatusShowsContent() {
72-
// Determine which statuses should show content (vs empty view)
72+
/// Determine which statuses should show content (vs empty view)
7373
func shouldShowContent(for status: BackendManager.BackendStatus) -> Bool {
7474
switch status {
7575
case .running:
@@ -91,7 +91,7 @@ final class BackendStatusViewStateTests: XCTestCase {
9191

9292
final class BackendStatusIconTests: XCTestCase {
9393
func testStatusIcons() {
94-
// Verify expected SF Symbol names for each status
94+
/// Verify expected SF Symbol names for each status
9595
func iconName(for status: BackendManager.BackendStatus) -> String? {
9696
switch status {
9797
case .stopped:
@@ -122,7 +122,7 @@ final class BackendStatusIconTests: XCTestCase {
122122

123123
final class BackendStatusTextTests: XCTestCase {
124124
func testStatusTitles() {
125-
// Verify title text for each status
125+
/// Verify title text for each status
126126
func titleText(for status: BackendManager.BackendStatus) -> String? {
127127
switch status {
128128
case .unknown, .starting:
@@ -144,7 +144,7 @@ final class BackendStatusTextTests: XCTestCase {
144144
}
145145

146146
func testStatusDescriptions() {
147-
// Verify description text for each status
147+
/// Verify description text for each status
148148
func descriptionText(for status: BackendManager.BackendStatus) -> String? {
149149
switch status {
150150
case .stopped:
@@ -162,7 +162,7 @@ final class BackendStatusTextTests: XCTestCase {
162162
}
163163

164164
func testButtonLabels() {
165-
// Verify button text for each actionable status
165+
/// Verify button text for each actionable status
166166
func buttonLabel(for status: BackendManager.BackendStatus) -> String? {
167167
switch status {
168168
case .stopped:

swift-gui/ARMEmulatorTests/Views/BreakpointsListViewTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ final class BreakpointSortingTests: XCTestCase {
7777

7878
final class BreakpointsEmptyStateTests: XCTestCase {
7979
func testEmptyStateCondition() {
80-
// Empty state shows when BOTH breakpoints and watchpoints are empty
80+
/// Empty state shows when BOTH breakpoints and watchpoints are empty
8181
func shouldShowEmptyState(breakpoints: Set<UInt32>, watchpoints: [Watchpoint]) -> Bool {
8282
breakpoints.isEmpty && watchpoints.isEmpty
8383
}

swift-gui/ARMEmulatorTests/Views/ConsoleViewTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import XCTest
55

66
final class ConsoleViewInputTests: XCTestCase {
77
func testInputProcessing() {
8-
// Simulate the sendInput() logic from ConsoleView
8+
/// Simulate the sendInput() logic from ConsoleView
99
func processInput(_ input: String) -> String? {
1010
guard !input.isEmpty else { return nil }
1111
return input + "\n"
@@ -18,7 +18,7 @@ final class ConsoleViewInputTests: XCTestCase {
1818
}
1919

2020
func testInputNewlineAppending() throws {
21-
// Verify newline is always appended
21+
/// Verify newline is always appended
2222
func processInput(_ input: String) -> String? {
2323
guard !input.isEmpty else { return nil }
2424
return input + "\n"
@@ -33,7 +33,7 @@ final class ConsoleViewInputTests: XCTestCase {
3333
}
3434

3535
func testEmptyInputRejection() {
36-
// Empty input should be rejected (guard clause)
36+
/// Empty input should be rejected (guard clause)
3737
func processInput(_ input: String) -> String? {
3838
guard !input.isEmpty else { return nil }
3939
return input + "\n"

swift-gui/ARMEmulatorTests/Views/ExamplesBrowserViewTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ final class ExampleProgramModelTests: XCTestCase {
9797

9898
final class ExamplesBrowserFilteringTests: XCTestCase {
9999
func testFilterByName() {
100-
// Simulate the filteredExamples logic
100+
/// Simulate the filteredExamples logic
101101
func filterExamples(
102102
_ examples: [ExampleProgram],
103103
searchText: String,
@@ -152,7 +152,7 @@ final class ExamplesBrowserFilteringTests: XCTestCase {
152152
}
153153

154154
func testFilterPartialMatches() {
155-
// Test partial matching behavior
155+
/// Test partial matching behavior
156156
func matches(_ text: String, searchText: String) -> Bool {
157157
text.localizedCaseInsensitiveContains(searchText)
158158
}
@@ -179,7 +179,7 @@ final class ExamplesBrowserFilteringTests: XCTestCase {
179179

180180
final class ExamplePreviewTests: XCTestCase {
181181
func testPreviewTruncation() {
182-
// Simulate the preview truncation logic
182+
/// Simulate the preview truncation logic
183183
func generatePreview(content: String, maxLines: Int = 15) -> String {
184184
let lines = content.components(separatedBy: .newlines)
185185
var preview = lines.prefix(maxLines).joined(separator: "\n")
@@ -234,7 +234,7 @@ final class ExamplePreviewTests: XCTestCase {
234234

235235
final class ExampleSelectionTests: XCTestCase {
236236
func testInitialSelection() {
237-
// Simulate initial selection behavior
237+
/// Simulate initial selection behavior
238238
func selectFirst(_ examples: [ExampleProgram]) -> ExampleProgram? {
239239
examples.isEmpty ? nil : examples[0]
240240
}
@@ -260,7 +260,7 @@ final class ExampleSelectionTests: XCTestCase {
260260
}
261261

262262
func testOpenButtonState() {
263-
// Open button should be disabled when no selection
263+
/// Open button should be disabled when no selection
264264
func isOpenButtonEnabled(selectedExample: ExampleProgram?) -> Bool {
265265
selectedExample != nil
266266
}
@@ -371,7 +371,7 @@ final class ExampleRowTests: XCTestCase {
371371

372372
final class SearchUITests: XCTestCase {
373373
func testSearchTextEmpty() {
374-
// Test the search clear button logic
374+
/// Test the search clear button logic
375375
func shouldShowClearButton(searchText: String) -> Bool {
376376
!searchText.isEmpty
377377
}
@@ -396,7 +396,7 @@ final class SearchUITests: XCTestCase {
396396

397397
final class CounterDisplayTests: XCTestCase {
398398
func testExampleCounter() {
399-
// Test the counter format: "N example(s)"
399+
/// Test the counter format: "N example(s)"
400400
func formatCounter(count: Int) -> String {
401401
"\(count) example(s)"
402402
}

swift-gui/ARMEmulatorTests/Views/ExpressionEvaluatorViewTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ final class ResultValueFormattingTests: XCTestCase {
6868
}
6969

7070
func testBinaryFormatting() {
71-
// Binary formatting with padding to 32 bits
71+
/// Binary formatting with padding to 32 bits
7272
func formatBinary(_ value: UInt32) -> String {
7373
let binary = String(value, radix: 2)
7474
return String(repeating: "0", count: max(0, 32 - binary.count)) + binary
@@ -220,7 +220,7 @@ final class ExpressionErrorHandlingTests: XCTestCase {
220220

221221
final class ExpressionFormStateTests: XCTestCase {
222222
func testEvaluateButtonDisabled() {
223-
// Button should be disabled when expression is empty or evaluating
223+
/// Button should be disabled when expression is empty or evaluating
224224
func isButtonDisabled(expression: String, isEvaluating: Bool) -> Bool {
225225
expression.isEmpty || isEvaluating
226226
}
@@ -232,7 +232,7 @@ final class ExpressionFormStateTests: XCTestCase {
232232
}
233233

234234
func testInputValidation() {
235-
// Test empty expression guard
235+
/// Test empty expression guard
236236
func shouldProceedWithEvaluation(expression: String) -> Bool {
237237
!expression.isEmpty
238238
}

swift-gui/ARMEmulatorTests/Views/MainViewToolbarTests.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import XCTest
77

88
final class ToolbarStatusIconTests: XCTestCase {
99
func testStatusIcons() {
10-
// Simulate the statusIcon computed property
10+
/// Simulate the statusIcon computed property
1111
func statusIcon(for status: VMState) -> String {
1212
switch status {
1313
case .running:
@@ -52,7 +52,7 @@ final class ToolbarStatusIconTests: XCTestCase {
5252

5353
final class ToolbarStatusColorTests: XCTestCase {
5454
func testStatusColors() {
55-
// Simulate the statusColor computed property
55+
/// Simulate the statusColor computed property
5656
func statusColor(for status: VMState) -> Color {
5757
switch status {
5858
case .running:
@@ -96,7 +96,7 @@ final class ToolbarStatusColorTests: XCTestCase {
9696

9797
final class ToolbarStatusTextTests: XCTestCase {
9898
func testStatusText() {
99-
// Simulate the statusText computed property
99+
/// Simulate the statusText computed property
100100
func statusText(for status: VMState) -> String {
101101
switch status {
102102
case .running:
@@ -156,7 +156,7 @@ final class ToolbarButtonLabelTests: XCTestCase {
156156
}
157157

158158
func testRunContinueButtonLabel() {
159-
// Button label changes based on status
159+
/// Button label changes based on status
160160
func runButtonLabel(for status: VMState) -> String {
161161
status == .breakpoint ? "Continue" : "Run"
162162
}
@@ -288,7 +288,7 @@ final class ToolbarKeyboardShortcutTests: XCTestCase {
288288

289289
final class ToolbarButtonDisabledTests: XCTestCase {
290290
func testRunButtonDisabled() {
291-
// Run button disabled when running or waiting for input
291+
/// Run button disabled when running or waiting for input
292292
func isRunButtonDisabled(status: VMState) -> Bool {
293293
status == .running || status == .waitingForInput
294294
}
@@ -302,7 +302,7 @@ final class ToolbarButtonDisabledTests: XCTestCase {
302302
}
303303

304304
func testPauseButtonDisabled() {
305-
// Pause button enabled only when canPause
305+
/// Pause button enabled only when canPause
306306
func isPauseButtonDisabled(canPause: Bool) -> Bool {
307307
!canPause
308308
}
@@ -312,7 +312,7 @@ final class ToolbarButtonDisabledTests: XCTestCase {
312312
}
313313

314314
func testStepButtonsDisabled() {
315-
// Step buttons enabled only when canStep
315+
/// Step buttons enabled only when canStep
316316
func isStepButtonDisabled(canStep: Bool) -> Bool {
317317
!canStep
318318
}
@@ -322,7 +322,7 @@ final class ToolbarButtonDisabledTests: XCTestCase {
322322
}
323323

324324
func testShowPCButtonDisabled() {
325-
// Show PC button disabled when PC is 0
325+
/// Show PC button disabled when PC is 0
326326
func isShowPCButtonDisabled(currentPC: UInt32) -> Bool {
327327
currentPC == 0
328328
}
@@ -359,7 +359,7 @@ final class ToolbarHelpTextTests: XCTestCase {
359359
}
360360

361361
func testHelpTextFormat() {
362-
// Help text format: "Action description (Shortcut)"
362+
/// Help text format: "Action description (Shortcut)"
363363
func formatHelpText(action: String, shortcut: String) -> String {
364364
"\(action) (\(shortcut))"
365365
}
@@ -369,7 +369,7 @@ final class ToolbarHelpTextTests: XCTestCase {
369369
}
370370

371371
func testDynamicHelpText() {
372-
// Run button help text changes based on status
372+
/// Run button help text changes based on status
373373
func runButtonHelpText(for status: VMState) -> String {
374374
status == .breakpoint
375375
? "Continue execution (⌘R)"

swift-gui/ARMEmulatorTests/Views/PreferencesViewTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import XCTest
66

77
final class AppSettingsColorSchemeTests: XCTestCase {
88
func testPreferredColorSchemeMapping() {
9-
// Simulate the preferredColorScheme computed property
9+
/// Simulate the preferredColorScheme computed property
1010
func preferredColorScheme(for value: String) -> ColorScheme? {
1111
switch value {
1212
case "light":
@@ -72,7 +72,7 @@ final class AppSettingsValidationTests: XCTestCase {
7272
}
7373

7474
func testBackendURLFormat() {
75-
// Verify valid backend URL formats
75+
/// Verify valid backend URL formats
7676
func isValidBackendURL(_ url: String) -> Bool {
7777
url.starts(with: "http://") || url.starts(with: "https://")
7878
}
@@ -188,7 +188,7 @@ final class GeneralPreferencesTests: XCTestCase {
188188
}
189189

190190
func testRecentFilesStepperLabel() {
191-
// Test the stepper label format
191+
/// Test the stepper label format
192192
func formatRecentFilesLabel(count: Int) -> String {
193193
"Recent Files: \(count)"
194194
}
@@ -220,7 +220,7 @@ final class EditorPreferencesTests: XCTestCase {
220220
}
221221

222222
func testFontSizeStepperLabel() {
223-
// Test the stepper label format
223+
/// Test the stepper label format
224224
func formatFontSizeLabel(size: Int) -> String {
225225
"Font Size: \(size)"
226226
}
@@ -231,7 +231,7 @@ final class EditorPreferencesTests: XCTestCase {
231231
}
232232

233233
func testFontSizeHelpText() {
234-
// Test the help text format
234+
/// Test the help text format
235235
func formatFontSizeHelpText(size: Int) -> String {
236236
"Current size: \(size) pt"
237237
}
@@ -414,7 +414,7 @@ final class TextFieldBehaviorTests: XCTestCase {
414414

415415
final class PreviewFontTests: XCTestCase {
416416
func testPreviewFontSize() {
417-
// Test font size application in preview
417+
/// Test font size application in preview
418418
func previewFontSize(from setting: Int) -> CGFloat {
419419
CGFloat(setting)
420420
}

swift-gui/ARMEmulatorTests/Views/RegistersViewTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class RegistersViewGridColumnsTests: XCTestCase {
1616
// - Width >= 700: 3 columns
1717

1818
func testGridColumnLogic() {
19-
// Simulate the gridColumns logic
19+
/// Simulate the gridColumns logic
2020
func gridColumns(for width: CGFloat) -> Int {
2121
if width < 500 {
2222
1
@@ -36,7 +36,7 @@ final class RegistersViewGridColumnsTests: XCTestCase {
3636
}
3737

3838
func testGridColumnEdgeCases() {
39-
// Test boundary conditions
39+
/// Test boundary conditions
4040
func gridColumns(for width: CGFloat) -> Int {
4141
if width < 500 {
4242
1

0 commit comments

Comments
 (0)