Enforce warning-free Swift builds#912
Closed
robinebers wants to merge 1 commit into
Closed
Conversation
6117059 to
85ee7ef
Compare
This was referenced Jul 10, 2026
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
The app and test targets now treat every Swift warning as an error. All existing warnings are resolved, including actor-isolated reset presentation logic that has been moved out of the SwiftUI view into a pure model.
What was happening
View, which implicitly isolated otherwise pure helpers to the main actor.What this changes
.treatAllWarnings(as: .error)for both the OpenUsage executable and test target.AGENTS.md.RateLimitResetsPresentationas a Foundation-only, independently tested model and keeps the view render-only.Heads-up
Tests
swift test— 962 XCTest tests passed, 3 skipped; 3 Swift Testing tests passedswift build— passed with warnings treated as errors./script/build_and_run.sh verify— warning-free release build, signing, launch, and process verification passedgit diff --checkNote
Low Risk
Mostly build policy and warning fixes plus a refactor with existing tests; behavior should be unchanged aside from stricter future builds.
Overview
Swift warnings are now CI-blocking for both the OpenUsage app and test targets via
.treatAllWarnings(as: .error)inPackage.swift, withAGENTS.mdupdated to match.Compiler hygiene: default provider pricing closures drop redundant
awaiton synchronousModelPricingStore.current();CopilotUsageMapperdropsnonisolated(unsafe)on its staticDateFormatter;ProviderSnapshotCacheexplicitly discards the set-insert result; and the login-shell off-main-thread test usesOSAllocatedUnfairLockinstead of capturing a mutablevaracross concurrency boundaries.Rate-limit resets popover: timeline formatting and the empty / count-only / timeline state machine move from
RateLimitResetsDetailintoRateLimitResetsPresentation(Foundation-only, independently unit-tested); the SwiftUI view only renders. No intended UI or copy change.Reviewed by Cursor Bugbot for commit 85ee7ef. Bugbot is set up for automated code reviews on this repo. Configure here.