-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Support flexible option specification in config file and inline configuration #7054
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
Conversation
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.
Thanks!
mypy/config_parser.py
Outdated
elif callable(ct): | ||
if invert: | ||
print("%sCan not invert non-boolean key %s" % (prefix, options_key), file=stderr) |
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.
Should this kind of errors be sys.exit(2)
?
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.
- Probably
- Similar errors are not
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.
@gvanrossum What do you think?
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.
When the mypy.ini file was new, I decided to make errors in the config file just print warnings. I can't recall why, possibly because the control flow to make them real errors was complex, or possibly because I was worried that people would have junk in their config files.
I'd stick to this tradition for now and do a separate sweep to clean it up later. (Maybe sections we don't recognize should not be fatal but in recognized sections, flags we don't understand should be fatal?)
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.
I'd stick to this tradition for now and do a separate sweep to clean it up later.
SGTM.
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.
This will invalidate some people's mypy.ini files, right? So it should be messaged carefully with the next release.
I don't think it really will? Certain configurations that currently produce a warning will instead have meaning, but I don't think that counts. |
Support inverting options based on
no_
, and adding or removing adis
prefixin the config file (and therefore in inline configuration also).
This moves the handling of
no_
prefixes from inline configuration to the config file.As a result, the config file is brought closer into alignment with the command line options.