-
Notifications
You must be signed in to change notification settings - Fork 7k
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 static type check with mypy #2195
Conversation
flake8 . | ||
flake8 --config=setup.cfg . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without setting this explicitly flake8
seems to ignore the config altogether. For an example see
setup.cfg
specifies to ignore F821
, but it still errors with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks a lot Philip!
@@ -9,5 +9,5 @@ max-line-length = 120 | |||
|
|||
[flake8] | |||
max-line-length = 120 | |||
ignore = F401,E402,F403,W503,W504 | |||
ignore = F401,E402,F403,W503,W504,F821 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, in the future we might want to remove this F821 and instead fix the annotations
For now
mypy
is configured to ignore every sub-package oftorchvision
. This restriction should be lifted PR by PR.@fmassa This also fixes one remaining syntax error not covered by #1696 as well as some errors that were missed in #2034. I've included them here to have clean CI build, but I can split them off in separate PRs if you want.