-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Support both warnings and errors #962
Comments
Things an ideal warning system does:
|
All of those could be pretty nice. Once somebody starts working on this, we could have separate issues for all of the enhancements so that we can discuss different designs. We should also think about various things that could generate warnings. Redundant casts (#958) is one example. Other possible things to warn about that come to mind:
|
|
As far as I can tell most of the things referred to above are implemented now. The specific feature that I would like which is not implemented is:
For example I see warnings such as: $ cat t.py
def f():
x: int = 1
$ mypy t.py
t.py:2: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
Success: no issues found in 1 source file
$ echo $? # exit code
0 I can silence the warning but I can't find any option to make it an error instead. |
We should have both errors (for things that clearly violate the type system) and warnings (for style issues and things that are suspicious but not necessarily problems). There should be a command line option for enabling/disabling warnings. Not sure whether warnings should be on by default -- probably yes.
The text was updated successfully, but these errors were encountered: