Skip to content
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 flexible option specification in config file and inline configuration #7054

Merged
merged 3 commits into from Jun 24, 2019

Conversation

@msullivan
Copy link
Collaborator

commented Jun 24, 2019

Support inverting options based on no_, and adding or removing a dis prefix
in 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.

@msullivan msullivan requested review from gvanrossum and ilevkivskyi Jun 24, 2019

@ilevkivskyi
Copy link
Collaborator

left a comment

Thanks!

elif callable(ct):
if invert:
print("%sCan not invert non-boolean key %s" % (prefix, options_key), file=stderr)

This comment has been minimized.

Copy link
@ilevkivskyi

ilevkivskyi Jun 24, 2019

Collaborator

Should this kind of errors be sys.exit(2)?

This comment has been minimized.

Copy link
@msullivan

msullivan Jun 24, 2019

Author Collaborator
  1. Probably
  2. Similar errors are not

This comment has been minimized.

Copy link
@ilevkivskyi

ilevkivskyi Jun 24, 2019

Collaborator

@gvanrossum What do you think?

This comment has been minimized.

Copy link
@gvanrossum

gvanrossum Jun 24, 2019

Member

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?)

This comment has been minimized.

Copy link
@ilevkivskyi

ilevkivskyi Jun 24, 2019

Collaborator

I'd stick to this tradition for now and do a separate sweep to clean it up later.

SGTM.

@gvanrossum
Copy link
Member

left a comment

This will invalidate some people's mypy.ini files, right? So it should be messaged carefully with the next release.

@msullivan

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 24, 2019

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.

@msullivan msullivan merged commit 46aa00d into master Jun 24, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@msullivan msullivan deleted the allow-disallow branch Jun 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.