Skip to content

Type annotations scorer does not count async functions #497

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions