diff --git a/mypy/main.py b/mypy/main.py index 405596c20991..bb8f1e112601 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -669,12 +669,13 @@ def add_invertible_flag( group=disallow_any_group, ) + # TODO: is the Note really helpful if --check-untyped-defs is enabled by default? (Maybe + # reword it to emphasize that mypy doesn't infer return types?) untyped_group = parser.add_argument_group( title="Untyped definitions and calls", description="Configure how untyped definitions and calls are handled. " - "Note: by default, mypy ignores any untyped function definitions " - "and assumes any calls to such functions have a return " - "type of 'Any'.", + "Note: by default, mypy assumes any calls to untyped " + "functions have a return type of 'Any'." ) add_invertible_flag( "--disallow-untyped-calls", @@ -700,10 +701,10 @@ def add_invertible_flag( group=untyped_group, ) add_invertible_flag( - "--check-untyped-defs", - default=False, - strict_flag=True, - help="Type check the interior of functions without type annotations", + "--no-check-untyped-defs", + default=True, + dest='check_untyped_defs', + help="Don't type check the interior of functions without type annotations", group=untyped_group, ) add_invertible_flag( diff --git a/mypy/options.py b/mypy/options.py index 3a08ff9455ee..5a79a8454e28 100644 --- a/mypy/options.py +++ b/mypy/options.py @@ -134,7 +134,7 @@ def __init__(self) -> None: self.disallow_incomplete_defs = False # Type check unannotated functions - self.check_untyped_defs = False + self.check_untyped_defs = True # Disallow decorating typed functions with untyped decorators self.disallow_untyped_decorators = False