Skip to content

fix simple/sort annotations to match callback return types#503

Merged
shcheklein merged 1 commit into
mainfrom
fix/simple-sort-annotations
Jul 9, 2026
Merged

fix simple/sort annotations to match callback return types#503
shcheklein merged 1 commit into
mainfrom
fix/simple-sort-annotations

Conversation

@shcheklein

Copy link
Copy Markdown
Member

Follow-up to #499, addressing Copilot's post-merge review comments: callback_simple normalizes --simple to None|bool and callback_sort returns VersionSort, but the command params were annotated str (carried over from the typer version). Annotate them truthfully and drop the five # type: ignore comments that the wrong annotations forced. api.assign's simple accepts None ("auto") at runtime, so it becomes Optional[bool] too.

No behavior change — mypy now passes without any ignores; full suite (188) green.

🤖 Generated with Claude Code

callback_simple normalizes --simple to None|bool and callback_sort
returns VersionSort; annotate the command params accordingly and drop
the type: ignore comments they forced. api.assign's simple param
accepts None ("auto") at runtime — annotate as Optional[bool].

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a follow-up to #499 that aligns CLI and API type annotations with the actual return types produced by click option callbacks, allowing removal of previously-required # type: ignore annotations and restoring clean mypy checking without changing runtime behavior.

Changes:

  • Update CLI command parameter annotations for --simple from str to Optional[bool] to match callback_simple’s None|bool normalization.
  • Update show --sort parameter annotation from str to VersionSort to match callback_sort’s enum return type.
  • Broaden gto.api.assign(..., simple=...) to Optional[bool] to reflect that None (“auto”) can be passed through from the CLI.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
gto/cli.py Updates command parameter type annotations to match click callback return types and removes now-unnecessary ignores.
gto/api.py Updates assign()’s simple annotation to Optional[bool] to match CLI “auto/true/false” normalization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shcheklein shcheklein merged commit a021c74 into main Jul 9, 2026
17 checks passed
@shcheklein shcheklein deleted the fix/simple-sort-annotations branch July 9, 2026 21:06
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.

3 participants