Skip to content

--strict does not include all mypy checks #14143

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

Open
TylerYep opened this issue Nov 19, 2022 · 0 comments
Open

--strict does not include all mypy checks #14143

TylerYep opened this issue Nov 19, 2022 · 0 comments

Comments

@TylerYep
Copy link

When configuring mypy, I mistakenly assumed that --strict included all possible mypy checks (thus being as strict as possible). However, there are a lot of other checks that are not included in --strict, such as --warn-unreachable or disallow_any_unimported = True or even enable_error_code = ignore-without-code.

Can we add a section to --strict's documentation and --help page explaining all of mypy's stricter checks that are not included in --strict? As far as I can tell, these are the missing ones:

[mypy]
strict = True

# Missing:
warn_unreachable = True
disallow_any_expr = True
disallow_any_decorated = True
disallow_any_explicit = True
disallow_any_unimported = True

# Not strictness checks per se, but enforces uniformity for type: ignores.
show_error_codes = True
enable_error_code = ignore-without-code

Additionally, it might be useful to add a --strictest flag that always opts into all of mypy's checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant