Skip to content

Update type checking to use ty #677

@abelaba

Description

@abelaba

I was working on updating the type checking from mypy to ty following this blog post, and I had a few questions before opening the PR.

Mypy Ty
disallow_any_generics Doesn't have a corresponding ty rule
disallow_untyped_defs Doesn't have a corresonding ty rule, but can be handled by adding Ruff rule ANN20
disallow_incomplete_defs Doesn't have a corresonding Ty rule, but can be handled by adding Ruff rule ANN001
For the test override ignore_errors This doesnt have a corresponding ty rule and the options are to either exclude the tests folder from type checking or manually add every rule that needs to be excluded.

In addition, when running the type checker using ty. It shows 93 diagnostics errors. It would bring lots of changes to resolve all of this errors in this PR, and the blog post also suggests running the ty type checker with --add-ignore flag, which adds ty: ignore[code] statements to each of the errors, and addressing this errors through follow up PRs.

Questions

  1. Should I proceed with the changes?
  2. Do we want to use a combination of mypy and ty?
  3. Does this mean the documentation for the enhancement proposal Type checkers and their configuration needs to be updated as well.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions