Skip to content

Enforce type checking #238

@maxrake

Description

@maxrake

Description

A portion of the Python code base makes use of type annotations. The entire code base should do so, to reduce bugs, improve quality, and enhance the IDE experience.

Additional Details

Use one of the more common type checkers - mypy, pyright, or pyre - and enforce standards by adding the checker to QA as a pre-commit hook.

Consider adding this setting to the ruff config for isort:

[tool.ruff.isort]
force-sort-within-sections = true
required-imports = ["from __future__ import annotations"]

If the selected type checker does not offer a pre-commit hook directly, check the published pre-commit hooks site for a "mirrored" one (e.g., for mypy)

References

Acceptance Criteria

  • All Python code is annotated with types
  • Type checking is enforced in QA
  • ruff rules for ANN (flake8-annotations) are no longer disabled
  • ruff rules for TCH (flake8-type-checking) are no longer disabled
  • ruff rules for FA (flake8-future-annotations) are no longer disabled
  • Documentation is updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    low priorityThis should be addressed as time permitstaskTask/chore unrelated to a bug or feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions