Skip to content

Add --no-auto-update flag to opt out of self-update check#63

Merged
albertodebortoli merged 1 commit intomainfrom
feature/no-auto-update-flag
Apr 12, 2026
Merged

Add --no-auto-update flag to opt out of self-update check#63
albertodebortoli merged 1 commit intomainfrom
feature/no-auto-update-flag

Conversation

@albertodebortoli
Copy link
Copy Markdown
Member

Pull Request Title

Add --no-auto-update flag to opt out of self-update check

Description

  • Every command (except update and --version) triggers a self-update check before running. This PR adds a --no-auto-update flag to suppress that behaviour on demand.
  • Introduces CommonFlags: ParsableArguments with the --no-auto-update flag, shared across all 7 non-update commands via @OptionGroup.
  • EntryPoint.swift detects the flag at the raw-argument level (consistent with the existing --version and update exemptions) before ArgumentParser dispatch.
  • No changes to UpdateCommand — it is already exempt from auto-update.

Type of Change

  • Feature

How Has This Been Tested?

  • Added / updated unit tests — no new unit tests needed (the change is a raw-argument guard in the entry point and a ParsableArguments struct)
  • Manually tested locally (describe) — swift run luca installed --no-auto-update skips the update block; swift run luca update --help correctly does not show the flag
  • Tested on macOS (arch: arm64)

Checklist

  • Swift code builds locally (swift build)
  • Tests pass locally (swift test) — 358 tests, all passing
  • Code style / formatting respected
  • Documentation updated (README / comments) — flag has full ArgumentHelp discussion string

CI Considerations

  • Affects build time notably
  • Requires new secrets / env vars
  • Alters release process

Breaking Changes?

  • No

Additional Notes

The --no-auto-update flag is particularly useful in CI environments and offline scenarios where the update check would either fail or add unwanted latency.

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.
@albertodebortoli albertodebortoli added this to the 0.15.0 milestone Apr 12, 2026
@albertodebortoli albertodebortoli added the feature New feature or enhancement label Apr 12, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@albertodebortoli albertodebortoli merged commit 9593d69 into main Apr 12, 2026
3 checks passed
@albertodebortoli albertodebortoli deleted the feature/no-auto-update-flag branch April 12, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant