diff options
| author | Christian Cleberg <[email protected]> | 2026-03-24 16:39:15 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-03-24 16:39:15 -0500 |
| commit | 8da2f907d690a59124d9008c0d8e1e792133702b (patch) | |
| tree | 79fcc86662155709fe2beb7b6559270254b96c01 /Hutch | |
| parent | 1f8a13e069ef5ebb7092803870d7152958ceb84e (diff) | |
| download | hutch-8da2f907d690a59124d9008c0d8e1e792133702b.tar.gz hutch-8da2f907d690a59124d9008c0d8e1e792133702b.tar.bz2 hutch-8da2f907d690a59124d9008c0d8e1e792133702b.zip | |
fix: add nested comments to satisfy sonar rule swift:S1186
Diffstat (limited to 'Hutch')
| -rw-r--r-- | Hutch/Extensions/SRHTShareUI.swift | 9 | ||||
| -rw-r--r-- | Hutch/Views/Builds/BuildDetailView.swift | 4 | ||||
| -rw-r--r-- | Hutch/Views/Inbox/ThreadDetailView.swift | 5 | ||||
| -rw-r--r-- | Hutch/Views/Pastes/PasteDetailView.swift | 4 | ||||
| -rw-r--r-- | Hutch/Views/Repositories/HgRepositorySettingsView.swift | 13 | ||||
| -rw-r--r-- | Hutch/Views/Repositories/RepositorySettingsView.swift | 8 | ||||
| -rw-r--r-- | Hutch/Views/Settings/SettingsView.swift | 8 | ||||
| -rw-r--r-- | Hutch/Views/Tickets/TicketDetailView.swift | 4 |
8 files changed, 42 insertions, 13 deletions
diff --git a/Hutch/Extensions/SRHTShareUI.swift b/Hutch/Extensions/SRHTShareUI.swift index 01f3d91..d09476f 100644 --- a/Hutch/Extensions/SRHTShareUI.swift +++ b/Hutch/Extensions/SRHTShareUI.swift @@ -40,7 +40,9 @@ struct SRHTShareButton<Label: View>: View { } } .alert("Share Unavailable", isPresented: $isShowingFallbackAlert) { - Button("OK", role: .cancel) {} + Button("OK", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } } message: { Text(target.fallbackMessage) } @@ -54,5 +56,8 @@ private struct ShareSheet: UIViewControllerRepresentable { UIActivityViewController(activityItems: activityItems, applicationActivities: nil) } - func updateUIViewController(_ uiViewController: UIActivityViewController, context: Context) {} + func updateUIViewController(_ uiViewController: UIActivityViewController, context: Context) { + // UIActivityViewController is fully configured in makeUIViewController. + // No state-driven updates are required. + } } diff --git a/Hutch/Views/Builds/BuildDetailView.swift b/Hutch/Views/Builds/BuildDetailView.swift index 104b961..1c2e2bb 100644 --- a/Hutch/Views/Builds/BuildDetailView.swift +++ b/Hutch/Views/Builds/BuildDetailView.swift @@ -87,7 +87,9 @@ struct BuildDetailView: View { } } .alert("Cancel Build?", isPresented: $showCancelConfirmation) { - Button("Keep Running", role: .cancel) {} + Button("Keep Running", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Cancel Build", role: .destructive) { Task { await viewModel?.cancelJob() } } diff --git a/Hutch/Views/Inbox/ThreadDetailView.swift b/Hutch/Views/Inbox/ThreadDetailView.swift index e4c34e7..143200f 100644 --- a/Hutch/Views/Inbox/ThreadDetailView.swift +++ b/Hutch/Views/Inbox/ThreadDetailView.swift @@ -277,7 +277,10 @@ private struct MailComposeView: UIViewControllerRepresentable { return controller } - func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} + func updateUIViewController(_ uiViewController: UIViewController, context: Context) { + // The view controller is fully configured in makeUIViewController. + // No state-driven updates are required. + } final class Coordinator: NSObject, MFMailComposeViewControllerDelegate { let onComplete: (Result) -> Void diff --git a/Hutch/Views/Pastes/PasteDetailView.swift b/Hutch/Views/Pastes/PasteDetailView.swift index df3a8be..19cfd52 100644 --- a/Hutch/Views/Pastes/PasteDetailView.swift +++ b/Hutch/Views/Pastes/PasteDetailView.swift @@ -63,7 +63,9 @@ struct PasteDetailView: View { } } .alert("Delete Paste?", isPresented: $showDeleteConfirmation) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Delete", role: .destructive) { Task { if await viewModel?.deletePaste() == true { diff --git a/Hutch/Views/Repositories/HgRepositorySettingsView.swift b/Hutch/Views/Repositories/HgRepositorySettingsView.swift index 5f45da8..6a27465 100644 --- a/Hutch/Views/Repositories/HgRepositorySettingsView.swift +++ b/Hutch/Views/Repositories/HgRepositorySettingsView.swift @@ -55,7 +55,9 @@ struct HgRepositorySettingsView: View { "Permanently delete \(repository.owner.canonicalName)/\(repository.name)?", isPresented: $showDeleteConfirmation ) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Delete", role: .destructive) { Task { await viewModel.deleteRepository() @@ -76,7 +78,9 @@ struct HgRepositorySettingsView: View { } } )) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Remove Access", role: .destructive) { guard let entry = pendingACLDeletion else { return } Task { @@ -234,7 +238,10 @@ struct HgRepositorySettingsView: View { .font(.caption) .foregroundStyle(.secondary) - Button("Remove Revision", role: .destructive) {} + Button("Remove Revision", role: .destructive) { + // Not implemented: the hg.sr.ht API does not expose a histedit endpoint. + // This button is disabled until the API supports revision removal. + } .disabled(true) } } diff --git a/Hutch/Views/Repositories/RepositorySettingsView.swift b/Hutch/Views/Repositories/RepositorySettingsView.swift index 5606ec6..ff72335 100644 --- a/Hutch/Views/Repositories/RepositorySettingsView.swift +++ b/Hutch/Views/Repositories/RepositorySettingsView.swift @@ -58,7 +58,9 @@ struct RepositorySettingsView: View { "Permanently delete \(repository.owner.canonicalName)/\(repository.name)?", isPresented: $showDeleteConfirmation ) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Delete", role: .destructive) { Task { await viewModel.deleteRepository() @@ -79,7 +81,9 @@ struct RepositorySettingsView: View { } } )) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Remove Access", role: .destructive) { guard let entry = pendingACLDeletion else { return } Task { diff --git a/Hutch/Views/Settings/SettingsView.swift b/Hutch/Views/Settings/SettingsView.swift index 30758a8..e90f4e3 100644 --- a/Hutch/Views/Settings/SettingsView.swift +++ b/Hutch/Views/Settings/SettingsView.swift @@ -99,7 +99,9 @@ struct SettingsView: View { } ) ) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button(pendingDestructiveAction?.confirmationLabel ?? "Confirm", role: .destructive) { guard let action = pendingDestructiveAction else { return } pendingDestructiveAction = nil @@ -608,7 +610,9 @@ private struct EditProfileSheet: View { } } .alert("Remove Avatar?", isPresented: $isShowingRemoveAvatarConfirmation) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Remove Avatar", role: .destructive) { Task { await viewModel.removeAvatar() diff --git a/Hutch/Views/Tickets/TicketDetailView.swift b/Hutch/Views/Tickets/TicketDetailView.swift index 0631d7f..6ed5df0 100644 --- a/Hutch/Views/Tickets/TicketDetailView.swift +++ b/Hutch/Views/Tickets/TicketDetailView.swift @@ -424,7 +424,9 @@ private struct EventRow: View { .padding(.horizontal) .padding(.vertical, 8) .alert("System Status Change", isPresented: $isShowingSystemStatusInfo) { - Button("OK", role: .cancel) {} + Button("OK", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } } message: { Text("This status change was recorded automatically or without a named user attached to the event.") } |
