seddonym / import-linter

Import Linter allows you to define and enforce rules for the internal and external imports within your Python project.
https://import-linter.readthedocs.io/
BSD 2-Clause "Simplified" License
679 stars 48 forks source link

Enable `warn_redundant_casts` for mypy #167

Closed flaeppe closed 1 year ago

flaeppe commented 1 year ago

I hope you think updating some type annotations is fine? As I thought it could be cool to get mypy to pass running in strict mode (mypy --strict)

What I tried to do here was to not do everything at once, but start out with enabling warn_redundant_casts and fix some of those issues.

I also saw that the pyproject.toml config for mypy took precedence over setup.cfg. So I tried to get a single config file going.

Additionally, for some reason mypy yielded a couple of info lines regarding tests/unit/domain/test_helpers.py. That's why those changes were included here.

seddonym commented 1 year ago

Nice - yes very happy to get stricter in terms of type checking. Thanks!