Mypy: No description for strict flag

Created on 29 Aug 2020  Â·  4Comments  Â·  Source: python/mypy

📚 Documentation

I haven't seen in the documentation explaining the effects of adding to mypy configuration file strict = True.

After some more search I saw this option in here but it only says it enables many (though not all) of the available strictness options – including --disallow-untyped-defs..

What would be very nice to have is a list of all checks/strictness options it enables.

documentation

Most helpful comment

Would it kill us to add a pseudo option to the config file that selects all strict options?

All 4 comments

As documented in https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-strict you can see the exact set of flags in mypy --help:

  --strict                  Strict mode; enables the following flags: --warn-
                            unused-configs, --disallow-any-generics,
                            --disallow-subclassing-any, --disallow-untyped-
                            calls, --disallow-untyped-defs, --disallow-
                            incomplete-defs, --check-untyped-defs, --disallow-
                            untyped-decorators, --no-implicit-optional,
                            --warn-redundant-casts, --warn-unused-ignores,
                            --warn-return-any, --no-implicit-reexport,
                            --strict-equality

The reason for the slight inconvenience, as per the documentation is:

Note: the exact list of flags enabled by running --strict may change over time.

Leaving the issue open since there's a good chance people feel like we're unlikely to make changes to --strict soon, and so maintenance burden of making the documentation more explicit is small.

Thanks a lot @hauntsaninja!

Would it kill us to add a pseudo option to the config file that selects all strict options?

@gvanrossum nice idea. There is a configuration for strictness in darglint that could be mirrored here.

strict = full # would be what you look for

Maybe we create another issue for that?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gregbedwell picture gregbedwell  Â·  3Comments

mxr picture mxr  Â·  3Comments

takeda picture takeda  Â·  3Comments

jstasiak picture jstasiak  Â·  3Comments

PeterJCLaw picture PeterJCLaw  Â·  3Comments