Add --strict#2700
Add --strict#2700alexjurkiewicz wants to merge 6 commits intopython:masterfrom alexjurkiewicz:strict-mode
Conversation
Changes mypy behaviour re: strict checking flags from opt-in to opt-out. Also adds --no-* options for all affected flags. Fixes #2585
|
Thanks for looking into this! I think the naming of the various no_xxx special_opts variables is confusing though. Also, e.g. Also as long as we're going to add then should check file.py without the strict optional flag. |
|
Thanks for the feedback! I've made Regarding the argument format, I was originally thinking of GCC's EDIT: I'm a little concerned by the new boilerplate that
But a cleaner way isn't immediately obvious... |
Still requires boilerplate for affected options: * Two options (one hidden) * Override default dest value * Special type for mypy.options.Options slot * Add to mypy.options.Options.STRICT_OPTIONS But most of these can be factored away with more work
|
You shouldn't need to have a separate explicit assignment step for the negated arguments: set Also, I'd prefer to see an abstraction for negatable flags over adding more boilerplate (which will be easier to forget when adding new arguments). This abstraction could potentially specify if they're supposed to be part of strict mode, too. |
|
Thanks for the feedback. Added a new commit which uses ternary flags for strict options. This simplifies logic a lot! This still requires boilerplate for affected options:
But I think the design is cleaner overall and we can cut down the boilerplate further. |
|
The CI failures are due to changing the default value for these params in types.py... not sure what the best approach here is. |
|
I think this still isn't quite the right approach. I have a pretty good idea of how we might avoid boilerplate nicely -- I think it'll be easier to implement than to explain, so I'm going to take a shot at it myself and you can tell me what you think. |
|
Closing in favour of #2710 |
Changes mypy behaviour re: strict checking flags from opt-in to opt-out.
Also adds --no-* options for all affected flags.
Fixes #2585.
This isn't fully tested yet, but I wanted to get feedback on whether this approach would be acceptable.