Description
I would like to be able to use some syntax like
# MYPY: strict
to turn on all the useful stricter-checking flags, like
--disallow-subclassing-any
--warn-return-any
--disallow-untyped-calls
--strict-optional
Not totally sure what each one does. Ideally we'd turn them all on globally, but ideally all our code would already be typed, and we don't live in that world. I'd prefer this to our current mypy.ini for a few reasons:
- makes it really easy to turn on - no need to edit a separate file to add the flags
- the setting follows the file around during renames and moves
- it eliminates the need to know all the different flags
I suppose we'll still want to introduce new flags over time - to make stricter checking opt in so large codebases don't have to migrate all at once. So either mypy standardizes ways to refer to a few flags (e.g. the first 3 could be called --strict-any? or --no-implicit-any like typescript?) or we could allow configuring these aliases in mypy.ini. I think I'm a fan of the former - provides more standardization across codebases.