From 0117a7b977d18e350539b093c720d474fdc10171 Mon Sep 17 00:00:00 2001 From: Quratulain-bilal Date: Tue, 28 Jul 2026 02:12:20 +0500 Subject: [PATCH] fix: correct Optional type annotation for context_note parameter (#3765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/specify_cli/agents.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/specify_cli/agents.py b/src/specify_cli/agents.py index ac568caf4..6f71aa368 100644 --- a/src/specify_cli/agents.py +++ b/src/specify_cli/agents.py @@ -270,7 +270,7 @@ class CommandRegistrar: return text def render_markdown_command( - self, frontmatter: dict, body: str, source_id: str, context_note: str = None + self, frontmatter: dict, body: str, source_id: str, context_note: Optional[str] = None ) -> str: """Render command in Markdown format. @@ -597,7 +597,7 @@ class CommandRegistrar: source_id: str, source_dir: Path, project_root: Path, - context_note: str = None, + context_note: Optional[str] = None, _resolved_dir: Path = None, link_outputs: bool = False, extension_id: Optional[str] = None, @@ -1016,7 +1016,7 @@ class CommandRegistrar: source_id: str, source_dir: Path, project_root: Path, - context_note: str = None, + context_note: Optional[str] = None, link_outputs: bool = False, create_missing_active_skills_dir: bool = False, extension_id: Optional[str] = None,