Skip to content

Type annotations scorer does not count async functions #497

@jwm4

Description

@jwm4

The TypeAnnotationsAssessor only checks isinstance(node, ast.FunctionDef) when walking the AST, so async def functions (ast.AsyncFunctionDef) are invisible to scoring. Repos heavy on async code (e.g., FastAPI, aiohttp) could show misleadingly high type annotation coverage because their async functions are never counted.

Fix should be straightforward: add ast.AsyncFunctionDef to the isinstance check.

Filed by Bill Murdock with assistance from Claude Code. Found while reviewing #493.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions