Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typechecking with Pyright #103

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sergei-maertens
Copy link
Member

I tend to favour Pyright because it's stricter out of the box than mypy, at the cost of not having plugins/support for django-stubs.

Quite some code had to be ignored - lots of it is legacy and/or we don't see a future for it anymore. I hope it doesn't create a culture of suppressing type errors in new code 😬

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependencies require version 2.0.0+, so this import shim was never being used anymore anyway

* Decided to ignore the lookups.py because... well, the Django ORM.
* and decided to ignore zgw_consumers.legacy which is scheduled
  for removal anyway, there are better places to sink our energy
  into
* zgw_consumers/api_models/base.py should be rewritten using pydantic
  OR be based on TypedDict - the code is not type checker friendly
The type checker correctly points out that the symbol doesn't exist.
This code cannot have worked in its 'current' state, so it
should be safe to delete.
@sergei-maertens sergei-maertens force-pushed the chore/add-typechecking-to-ci branch from 4bb3fdd to 42a1b2e Compare November 29, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant