Skip to content

fix: correct Optional type annotation for context_note parameter - #3765

Merged
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/type-annotation-context-note
Jul 27, 2026
Merged

fix: correct Optional type annotation for context_note parameter#3765
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/type-annotation-context-note

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Summary

The context_note parameter in CommandRegistrar methods was annotated as str = None - a type lie where the default is None but the type hint says str. Static type checkers (mypy/pyright) flag this as an error.

Changes

  • src/specify_cli/agents.py (lines 273, 600, 1019): Changed context_note: str = None to context_note: Optional[str] = None, consistent with how extension_id in the same class is already typed.

Testing

This is a type-correctness fix - no runtime behavior change. Existing tests continue to pass.

The context_note parameter in CommandRegistrar methods was annotated as
\str = None\ which is a type lie — the default is None but the type
hint says str. Static type checkers (mypy/pyright) would flag this as
an error. Changed to \Optional[str] = None\ for correctness, consistent
with how extension_id (same class) is already typed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Corrects nullable context_note annotations without changing runtime behavior.

Changes:

  • Uses Optional[str] for all affected parameters.
  • Aligns annotations with existing typing conventions.
Show a summary per file
File Description
src/specify_cli/agents.py Corrects three nullable parameter annotations.

Review details

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Medium

@mnriem
mnriem merged commit 0117a7b into github:main Jul 27, 2026
14 checks passed
@mnriem

mnriem commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

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