fix: update mypy allowlist paths and fix BaseSuite type narrowing

Update stale context/ paths in mypy_allowlist.txt to match the
languages/python/context/ move. Add assert to narrow BaseSuite to
IndentedBlock in prune_cst for mypy.
This commit is contained in:
Kevin Turcios 2026-02-16 15:10:58 -05:00
parent b1ec82413e
commit 8566cf0510
2 changed files with 5 additions and 3 deletions

View file

@ -1180,7 +1180,9 @@ def prune_cst(
# Apply docstring removal to class if needed
if remove_docstrings and new_class_body:
return node.with_changes(body=remove_docstring_from_body(node.body.with_changes(body=new_class_body))), True
updated_body = node.body.with_changes(body=new_class_body)
assert isinstance(updated_body, cst.IndentedBlock)
return node.with_changes(body=remove_docstring_from_body(updated_body)), True
return node.with_changes(body=node.body.with_changes(body=new_class_body)) if new_class_body else None, True

View file

@ -6,8 +6,8 @@ codeflash/result/explanation.py
codeflash/result/critic.py
codeflash/version.py
codeflash/optimization/__init__.py
codeflash/context/__init__.py
codeflash/context/code_context_extractor.py
codeflash/languages/python/context/__init__.py
codeflash/languages/python/context/code_context_extractor.py
codeflash/discovery/__init__.py
codeflash/__init__.py
codeflash/models/ExperimentMetadata.py