Add --no-auto-update flag to opt out of self-update check#63
Merged
albertodebortoli merged 1 commit intomainfrom Apr 12, 2026
Merged
Add --no-auto-update flag to opt out of self-update check#63albertodebortoli merged 1 commit intomainfrom
albertodebortoli merged 1 commit intomainfrom
Conversation
Introduces CommonFlags: ParsableArguments with a --no-auto-update flag, embedded via @OptionGroup in all commands except UpdateCommand. The entry point detects the flag at the raw-argument level (consistent with the existing --version and update exemptions) to skip the self-update check before ArgumentParser dispatch.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Pull Request Title
Add --no-auto-update flag to opt out of self-update check
Description
updateand--version) triggers a self-update check before running. This PR adds a--no-auto-updateflag to suppress that behaviour on demand.CommonFlags: ParsableArgumentswith the--no-auto-updateflag, shared across all 7 non-update commands via@OptionGroup.EntryPoint.swiftdetects the flag at the raw-argument level (consistent with the existing--versionandupdateexemptions) before ArgumentParser dispatch.UpdateCommand— it is already exempt from auto-update.Type of Change
How Has This Been Tested?
swift run luca installed --no-auto-updateskips the update block;swift run luca update --helpcorrectly does not show the flagChecklist
CI Considerations
Breaking Changes?
Additional Notes
The
--no-auto-updateflag is particularly useful in CI environments and offline scenarios where the update check would either fail or add unwanted latency.