Skip to content

fix: resolve SwiftFormat CI failures (swiftTestingTestCaseNames, redundantSwiftTestingSuite, and others)#138

Open
Copilot wants to merge 2 commits intomainfrom
copilot/update-netmonitor-configuration
Open

fix: resolve SwiftFormat CI failures (swiftTestingTestCaseNames, redundantSwiftTestingSuite, and others)#138
Copilot wants to merge 2 commits intomainfrom
copilot/update-netmonitor-configuration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

Summary

The SwiftFormat step in the Lint CI workflow was failing with 462 violations across 130 files, all auto-fixable. Ran swiftformat . against the project's existing .swiftformat config to resolve.

Changes

  • swiftTestingTestCaseNames (~121 files): Removed redundant string labels from @Suite("TypeName") when the name is derivable from the struct — e.g. @Suite("TracerouteToolViewModel", .serialized)@Suite(.serialized) on struct TracerouteToolViewModelTests
  • redundantSwiftTestingSuite (~105 files): Removed bare @Suite attributes with no arguments or traits (no-op decorators)
  • redundantSendable (7 files): Removed explicit : Sendable from enums/types where conformance is already implied
  • redundantGet (1 file): Removed explicit get {} block from single-accessor computed properties
  • blankLinesBetweenScopes (1 file): Added missing blank line before a function declaration inside an actor
  • semicolons (1 file): Split semicolon-joined statements onto separate lines
  • todos (1 file): /// TODO: (doc comment) → // TODO: (regular comment)

No logic changes — purely formatting corrections enforced by the existing .swiftformat config.

Testing Done

  • Unit tests pass (xcodebuild test -scheme NetMonitor-macOS on mac-mini)
  • iOS tests pass (xcodebuild test -scheme NetMonitor-iOS on mac-mini)
  • SwiftLint clean — no new errors (swiftlint lint --quiet)
  • SwiftFormat clean — no reformats needed (swiftformat --lint .)
  • Manual verification on device / simulator

Notes for Reviewer

No semantic changes. All 553 Swift files pass swiftformat --lint . with 0 violations after this commit. The two new SwiftFormat rules (swiftTestingTestCaseNames, redundantSwiftTestingSuite) are default-enabled in SwiftFormat 0.59+ and were not previously disabled in .swiftformat.

Fix 462 SwiftFormat violations across 130 files:
- swiftTestingTestCaseNames: remove redundant @suite string names
- redundantSwiftTestingSuite: remove @suite with no args
- redundantSendable: remove redundant Sendable conformances
- redundantGet: remove explicit get accessor
- blankLinesBetweenScopes: add blank line before func declarations
- semicolons: split multi-statement lines
- todos: convert /// TODO: to // TODO:"

Agent-Logs-Url: https://github.com/jbcrane13/NetMonitor-2.0/sessions/9fe35655-c8fa-4b73-976a-2482f2157de7

Co-authored-by: jbcrane13 <25068427+jbcrane13@users.noreply.github.com>
Copilot AI changed the title [WIP] Update NetMonitor configuration file fix: resolve SwiftFormat CI failures (swiftTestingTestCaseNames, redundantSwiftTestingSuite, and others) Apr 10, 2026
Copilot AI requested a review from jbcrane13 April 10, 2026 03:46
@jbcrane13 jbcrane13 requested a review from Copilot April 10, 2026 05:54
@jbcrane13 jbcrane13 marked this pull request as ready for review April 10, 2026 05:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the codebase to satisfy the existing SwiftFormat configuration (SwiftFormat 0.59+ / Swift 6 mode) and unblock the Lint CI workflow by applying auto-fixable formatting and redundancy rules across tests and a few source files.

Changes:

  • Removes/normalizes Swift Testing @Suite(...) usage (drops redundant labels, removes no-op @Suite attributes, keeps traits like .serialized).
  • Removes redundant Sendable conformances and applies a few small formatting corrections (e.g., redundant get {}, semicolon splitting, blank lines).
  • Minor comment normalization (e.g., /// TODO:// TODO:) per SwiftFormat rules.

Reviewed changes

Copilot reviewed 130 out of 130 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Tests/NetMonitor-macOSTests/WakeOnLanActionTests.swift Removes redundant Swift Testing @Suite name.
Tests/NetMonitor-macOSTests/UptimeViewModelTests.swift Drops custom @Suite name and keeps .serialized.
Tests/NetMonitor-macOSTests/StatisticsServiceTests.swift Removes multiple redundant @Suite names.
Tests/NetMonitor-macOSTests/ShellPingParserTests.swift Removes redundant @Suite names for multiple suites.
Tests/NetMonitor-macOSTests/ShellPingParserExtendedTests.swift Removes redundant @Suite name.
Tests/NetMonitor-macOSTests/ShellCommandRunnerTests.swift Removes redundant @Suite name.
Tests/NetMonitor-macOSTests/NetworkInfoServiceTests.swift Removes redundant @Suite names.
Tests/NetMonitor-macOSTests/NetworkHealthScoreViewModelTests.swift Removes redundant @Suite names; preserves @MainActor suites.
Tests/NetMonitor-macOSTests/NetworkHealthScoreServiceTests.swift Removes redundant @Suite names.
Tests/NetMonitor-macOSTests/NetworkDetailViewTests.swift Drops custom @Suite names; keeps .serialized.
Tests/NetMonitor-macOSTests/NetworkDetailViewScanRegressionTests.swift Drops @Suite string name; keeps .serialized.
Tests/NetMonitor-macOSTests/NetMonitor_macOSTests.swift Removes redundant @Suite names.
Tests/NetMonitor-macOSTests/MonitoringSessionTests.swift Drops @Suite string name; keeps .serialized.
Tests/NetMonitor-macOSTests/MonitoringSessionExtendedTests.swift Adds blank line; splits semicolon-joined statements; drops @Suite string names while keeping .serialized.
Tests/NetMonitor-macOSTests/ISPCardViewModelExtendedTests.swift Removes redundant @Suite names.
Tests/NetMonitor-macOSTests/ISPCardErrorSurfacingTests.swift Removes redundant @Suite names.
Tests/NetMonitor-macOSTests/GatewayLatencyFallbackTests.swift Drops @Suite string name; keeps .serialized.
Tests/NetMonitor-macOSTests/DeviceDiscoveryCoordinatorTests.swift Drops @Suite string name; keeps .serialized.
Tests/NetMonitor-macOSTests/DeviceDiscoveryCoordinatorExtendedTests.swift Drops @Suite string name; keeps .serialized.
Tests/NetMonitor-macOSTests/DefaultTargetsProviderTests.swift Removes redundant @Suite name.
Tests/NetMonitor-macOSTests/DashboardModelsTests.swift Removes redundant @Suite names.
Tests/NetMonitor-macOSTests/ContinuationTrackerTests.swift Removes redundant @Suite names.
Tests/NetMonitor-macOSTests/CompanionMessageHandlerTests.swift Drops @Suite string name; keeps .serialized.
Tests/NetMonitor-macOSTests/CompanionMessageHandlerExtendedTests.swift Drops @Suite string name; keeps .serialized.
Tests/NetMonitor-macOSTests/ARPScannerServiceTests.swift Removes redundant @Suite names for multiple suites.
Tests/NetMonitor-iOSTests/WorldPingToolViewModelTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/WiFiInfoServiceCacheTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/WHOISToolViewModelTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/WakeOnLANToolViewModelTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/VPNInfoViewModelTests.swift Removes redundant @Suite names across suites.
Tests/NetMonitor-iOSTests/TracerouteToolViewModelTests.swift Drops redundant @Suite string name; removes extra suite name for error tests.
Tests/NetMonitor-iOSTests/ToolsViewModelTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/TimelineViewModelTests.swift Removes redundant @Suite names.
Tests/NetMonitor-iOSTests/ThemeTests.swift Removes redundant @Suite names.
Tests/NetMonitor-iOSTests/TargetManagerTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/TargetManagerExtendedTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/SubnetCalculatorToolViewModelTests.swift Removes redundant @Suite name for Swift Testing suite section.
Tests/NetMonitor-iOSTests/SSLCertificateMonitorViewModelTests.swift Removes redundant @Suite names.
Tests/NetMonitor-iOSTests/SpeedTestToolViewModelTests.swift Removes redundant @Suite names across suites.
Tests/NetMonitor-iOSTests/SharedViewModelHelpersTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/SettingsViewModelTests.swift Removes redundant @Suite names across suites.
Tests/NetMonitor-iOSTests/ScheduledScanViewModelTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/PostScanRefinementTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/PortScannerToolViewModelTests.swift Drops redundant @Suite string name; removes extra suite name for error tests.
Tests/NetMonitor-iOSTests/PingToolViewModelTests.swift Drops redundant @Suite string name(s); keeps .serialized where present.
Tests/NetMonitor-iOSTests/NetworkMapViewModelTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/NetworkHealthScoreViewModelTests.swift Removes redundant @Suite names.
Tests/NetMonitor-iOSTests/NetworkEventServiceTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/MacConnectionServiceReceiveBufferTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/LiveActivityManagerTests.swift Removes redundant @Suite names across multiple suites.
Tests/NetMonitor-iOSTests/GatewayServiceTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/DNSLookupToolViewModelTests.swift Removes redundant @Suite names.
Tests/NetMonitor-iOSTests/DeviceDetailViewModelTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/DataExportServiceTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/DataExportServiceExtendedTests.swift Removes redundant @Suite name.
Tests/NetMonitor-iOSTests/DashboardViewModelTests.swift Removes redundant @Suite name; keeps .serialized suite trait.
Tests/NetMonitor-iOSTests/BonjourDiscoveryToolViewModelTests.swift Drops redundant @Suite string name; keeps .serialized.
Tests/NetMonitor-iOSTests/AppSettingsTests.swift Removes redundant @Suite names.
Tests/NetMonitor-iOSTests/AppIntentsTests.swift Removes redundant @Suite names across suites.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/ThermalThrottleMonitorTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/SSDPScanPhaseTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/ScanPipelineTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/ScanPipelineRealIntegrationTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/ScanPipelineIntegrationTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/ScanEngineTests.swift Removes redundant @Suite name; removes redundant Sendable on nested type.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/ScanContextTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/ScanAccumulatorTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/RTTTrackerTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/ResumeStateTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/IPv4HelpersTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/DiscoveredDeviceTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/ConnectionBudgetTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Tests/NetworkScanKitTests/ARPCacheScannerTests.swift Removes redundant @Suite name.
Packages/NetworkScanKit/Sources/NetworkScanKit/Phases/TCPProbeScanPhase.swift Removes redundant Sendable on private enums.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/WorldPingServiceErrorTests.swift Drops @Suite string name; keeps .serialized.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/WorldPingRegressionTests.swift Drops @Suite string names; keeps .serialized; removes one redundant no-trait suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/WorldPingModelsTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/WiFiMeasurementEngineTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/WHOISServiceTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/WHOISServiceContractTests.swift Removes redundant @Suite names (including integration suite name).
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/WakeOnLANServiceTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/VPNDetectionServiceTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/TracerouteServiceTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/ToolModelsTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/SSLCertificateServiceTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/SSLCertificateServiceIntegrationTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/SSLCertificateContractTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/SpeedTestServiceTests.swift Removes redundant @Suite names.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/SpeedTestServiceIntegrationTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/SpeedTestServiceContractTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/ServiceUtilitiesTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/ServiceProtocolTypesTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/ScanSchedulerServiceTests.swift Drops @Suite string name; keeps .serialized.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/ScanDiffTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/ResumeStateTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/RemainingModelsTests.swift Removes redundant @Suite names across multiple model test suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/RegressionTests.swift Removes redundant @Suite names.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/ProjectSaveLoadManagerTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/PortScannerServiceTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/PingServiceTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/PingServiceIntegrationTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/NetworkUtilitiesTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/NetworkProfileManagerTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/NetworkProfileManagerExtendedTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/NetworkModelsTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/NetworkHealthScoreServiceTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/NetworkEventServiceTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/NetworkEventModelsTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/NetworkErrorTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/MACVendorLookupServiceTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/MACVendorContractTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/LogSanitizerTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/ICMPSocketTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/GeoLocationServiceTests.swift Drops @Suite string name; keeps .serialized.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/GeoLocationContractTests.swift Drops @Suite string name; keeps .serialized.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/FormattingExtensionsTests.swift Removes redundant @Suite names.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/EnumsTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/DNSLookupServiceTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/DNSLookupServiceIntegrationTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/ContractTests.swift Drops @Suite string names (outer suite still .serialized); nested suites now rely on type names.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/CompanionMessageTests.swift Removes redundant @Suite names across suites.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/CertificateExpirationTrackerTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Tests/NetMonitorCoreTests/BonjourDiscoveryServiceTests.swift Removes redundant @Suite name.
Packages/NetMonitorCore/Sources/NetMonitorCore/Services/TracerouteService.swift Removes redundant Sendable on private enum.
Packages/NetMonitorCore/Sources/NetMonitorCore/Services/ObservabilityService.swift Removes redundant get {} from single-accessor computed property formatting.
Packages/NetMonitorCore/Sources/NetMonitorCore/Services/ICMPSocket.swift Removes redundant Sendable conformances on internal types.
Packages/NetMonitorCore/Sources/NetMonitorCore/Services/DeviceDiscoveryService.swift Removes redundant Sendable on private helper types.
NetMonitor-iOS/Platform/RateAppService.swift Converts doc-comment TODO to regular TODO comment (SwiftFormat rule).
NetMonitor-iOS/Platform/GeoFenceManager.swift Removes redundant Sendable conformances on internal models.
NetMonitor-iOS/Platform/DataExportService.swift Removes redundant Sendable conformance on export format enum.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10 to 12
@Suite(.serialized)
@MainActor
struct UptimeViewModelTests {
Comment on lines +34 to 36
@Suite(.serialized)
@MainActor
struct NDVGatewayLatencyFallbackTests {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants