fix: correct Optional type annotation for context_note parameter (#3765)

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.
This commit is contained in:
Quratulain-bilal
2026-07-28 02:12:20 +05:00
committed by GitHub
parent 2355fcb350
commit 0117a7b977

View File

@@ -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,