fix: add missing type annotations to public API functions#619
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
|
The PR description has been updated. Please fill out the template for your PR to be reviewed. |
jakelorocco
left a comment
There was a problem hiding this comment.
These changes seem reasonable. Were these changes made through Bob or a formal type system? Would like to know to help confirm whether we need to check all by hand.
|
Reviewed all One avoidable |
Adds return type and parameter annotations to ~50 functions across the 14 high-priority public API files identified in issue generative-computing#615. Also fixes two latent type bugs uncovered during annotation: - stdlib/requirements/md.py: _md_list/_md_table were returning bare bool where Requirement.validate() expected ValidationResult; wrap in ValidationResult(result=...) - stdlib/tools/interpreter.py: add narrowing asserts for stdout/stderr to confirm the -> str return type that the top-level assert guarantees Closes generative-computing#615
by claude - note one correction above from a lazy Any. That has been left on tracing due to import complexities (which would need multiple guards and add little benefit). This is a subset of missing mypy annotations - selection was driven by references in the newly generated api docs (to be merged) |
jakelorocco
left a comment
There was a problem hiding this comment.
changes seem reasonable
97b2ceb
…-computing#619) Adds return type and parameter annotations to ~50 functions across the 14 high-priority public API files identified in issue generative-computing#615. Also fixes two latent type bugs uncovered during annotation: - stdlib/requirements/md.py: _md_list/_md_table were returning bare bool where Requirement.validate() expected ValidationResult; wrap in ValidationResult(result=...) - stdlib/tools/interpreter.py: add narrowing asserts for stdout/stderr to confirm the -> str return type that the top-level assert guarantees Closes generative-computing#615
Misc PR
Type of PR
Description
Adds missing return-type and parameter annotations to ~75 functions across 14 public API files. Griffe (the doc pipeline) requires annotations to generate correct return-type cross-references in the API reference; without them it emits
no_returnsaudit failures and renders stubs with no linked types. Two latent bugs were also surfaced:_md_list/_md_tablewere returning bareboolwhereRequirement.validation_fnexpectsValidationResult, andto_validationresult_reasonhad a narrowing gap that mypy could not verify. Both are fixed here.Testing