Skip to content

cli: one shared decorator for --github-token / --github-token-file - #149

Merged
IkarusAILabs merged 2 commits into
IkarusAILabs:mainfrom
chiragjangiir:refactor/140-shared-github-auth-options
Oct 25, 2026
Merged

IkarusAILabs merged 2 commits into
IkarusAILabs:mainfrom
chiragjangiir:refactor/140-shared-github-auth-options

Conversation

@chiragjangiir

Copy link
Copy Markdown
Contributor

Resolves #140

Problem

Commands that take repository URLs (check, digest, warnings, and attest) duplicated the declaration of --github-token and --github-token-file across 4 separate functions with identical option arguments and help strings.

Solution

  • Introduced _github_auth_options decorator helper in cli/main.py.
  • Applied @_github_auth_options across check, digest, warnings, and attest, reducing boilerplate and keeping option declarations centralized.
  • Retained exact argument types, defaults, and help messages.

Validation

  • pytest tests/test_github_token_cli.py passes (12 passed).
  • CLI --help tested across check, digest, warnings, and attest.
  • ruff check cli/main.py passes with 0 errors.

@IkarusAILabs
IkarusAILabs merged commit 5a2cf6e into IkarusAILabs:main Oct 25, 2026
8 checks passed
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.

cli: one shared decorator for --github-token / --github-token-file

2 participants