Silence unused-result warnings on createMockProfile#51
Merged
Conversation
Several ProvisionServiceTests call createMockProfile only for its side effect (the file it writes) and discard the returned path. Each call emitted a [#no-usage] warning under Swift 6.2 strict diagnostics. Add @discardableResult to the helper so callers that don't need the path no longer trip the warning.
There was a problem hiding this comment.
Pull request overview
This PR updates the ProvisionServiceTests helper createMockProfile to silence Swift 6.2 strict diagnostics warnings at call sites that intentionally ignore its returned path, while still keeping the return value available for callers that do use it.
Changes:
- Add
@discardableResulttoProvisionServiceTests.createMockProfile(...)to suppress unused-result warnings in tests.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Adds
@discardableResulttoProvisionServiceTests.createMockProfile. Roughly a dozen call sites inProvisionServiceTests.swiftinvoke it for the side effect (writing a mock.mobileprovisionfile) and discard the returned path. Under Swift 6.2 strict diagnostics each emits a[#no-usage]warning. One-character change to the helper silences all of them — confirmed locally:XprojectTestsbuilds with zero warnings after.Test plan
swift build --target XprojectTests— clean, no warningsswift test --filter ProvisionService— still passesclaude-code-reviewworkflow now produces a useful review (this is the first PR after Broaden tool allowlist for claude-code-review workflow #50 merged — the real point of opening it)