-
Notifications
You must be signed in to change notification settings - Fork 123
Closed
Description
Would you be interested in stricter type hint linting? I've implemented these additional mypy settings in another project already:
- check_untyped_defs "Type-checks the interior of functions without type annotations."
- disallow_any_generics "Disallows usage of generic types that do not specify explicit type parameters."
- no_implicit_optional "Changes the treatment of arguments with a default value of
None
by not implicitly making their typeOptional
." Basically, declaring a parameterfoo: str = None
becomes an error, rather than being implicitly treated asOptional[str]
. - show_error_codes "Shows error codes in error messages." This makes it easier to write
type: ignore[SPECIFIER]
comments (which are more specific than the big hammer,type: ignore
), since theSPECIFIER
part of that is part of the error message. - warn_redundant_casts "Warns about casting an expression to its inferred type."
- warn_return_any "Shows a warning when returning a value with type
Any
from a function declared with a non-Any
return type." - warn_unused_ignores "Warns about unneeded
# type: ignore
comments."
I've also avoided ignore_missing_imports
simply by marking only a handful of specific imports as ignored.
Metadata
Metadata
Assignees
Labels
No labels