-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Replace --disallow-any
flags with separate boolean flags.
#4178
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
This PR also gets rid of `--disallow-any=unannotated` because it is the same thing as `--disallow-untyped-defs`. Fix python#4089
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!
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.
Beautiful! I have a few new nits on the help strings, will post later.
mypy/main.py
Outdated
parser.add_argument('--disallow-any-unimported', default=False, action='store_true', | ||
help="disallow usage of types that come from unfollowed imports") | ||
parser.add_argument('--disallow-any-expr', default=False, action='store_true', | ||
help='disallow all expressions in the module that have type Any') |
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 drop "in the module" since that's implicit (and you don't say it for the other flags).
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.
Yep!
mypy/main.py
Outdated
help="disallow various types of Any in a module. Takes a comma-separated " | ||
"list of options (defaults to all options disabled)") | ||
parser.add_argument('--disallow-any-unimported', default=False, action='store_true', | ||
help="disallow usage of types that come from unfollowed imports") |
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.
Maybe "disallow Any types resulting from unfollowed imports" ?
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.
Yep, this seems reasonable! Done!
Thanks! Now I have a whole bunch of internal mypy.ini files to clean up... |
This PR also gets rid of
--disallow-any=unannotated
because itis the same thing as
--disallow-untyped-defs
.Fix #4089