-
Notifications
You must be signed in to change notification settings - Fork 0
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
PB-1056 Tighten type checking rules #28
Conversation
General comment: Wouldn't it be easier to just set the strict mode and maybe disable things we absolutely don't want? I had a go at this in branch Explicitly listing all the rules we want has the risk that mypy adds checks in the future and we don't add them here. Going with the |
Good idea to use strict per default and relax specific rules, but I would use strict in the config file, rather than the CLI as the config file will also be considered in vscode. |
@asteiner-swisstopo it's now as strict as your branch. I didn't use the monkeypatch part, as this results in a linting error. I think it's better to use a |
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.
Very nice, just a small question!
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 already pretty good, found some more opportunities to rely more on the default settings on strict mode.
5571bfb
to
693088b
Compare
The type checker is more useful when more checks are activated, as it allow to to checking for undefined attributes or missing overloads, for example.
I suggest that we enable some additional checks:
disallow_untyped_defs
,disallow_incomplete_defs
,disallow_untyped_decorators
)check_untyped_defs
)warn_unused_ignores
,warn_no_return
,warn_unreachable
)strict_equality
)But only for our own code (
ignore_missing_imports
) and not for tests (exclude
).