Skip to content

Enable Ruff ANN rules for Python annotation coverage #100

Description

@dkropachev

Summary

The Python SDK currently runs Ruff, but the selected rule set only includes E, F, I, B, and C4. Ruff's annotation rules (ANN...) are not enabled, so CI does not enforce missing function argument or return annotations.

Motivation

Adding Ruff ANN gives a fast, low-cost guardrail that keeps new Python code annotated. This is complementary to a full type checker: Ruff can require annotations to exist, while mypy or pyright validates whether the annotations are correct.

Proposed work

  • Enable an appropriate subset of Ruff ANN rules for the Python SDK.
  • Decide whether tests, examples, generated code, or small local callbacks need scoped ignores.
  • Keep existing generated code excluded from annotation enforcement.
  • Update CI only through the existing ruff check path; avoid adding a separate annotation-only job unless needed.

Acceptance criteria

  • uv run --extra dev ruff check . in sdk/python reports missing annotations for newly covered SDK code.
  • Existing intentional exceptions are documented through narrow per-file ignores or inline noqa comments.
  • The change does not require broad unrelated annotation churn outside the intended Python SDK scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions