diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index d667fa0ff727..35156035951f 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -813,9 +813,6 @@ of the above sections. strict will catch type errors as long as intentional methods like type ignore or casting were not used.) - Note: the :option:`--warn-unreachable` flag - is not automatically enabled by the strict flag. - The strict flag does not take precedence over other strict-related flags. Directly specifying a flag of alternate behavior will override the behavior of strict, regardless of the order in which they are passed. diff --git a/mypy/main.py b/mypy/main.py index 9ebbf78ded09..c919be66c441 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -837,7 +837,7 @@ def add_invertible_flag( add_invertible_flag( "--warn-unreachable", default=False, - strict_flag=False, + strict_flag=True, help="Warn about statements or expressions inferred to be unreachable", group=lint_group, ) diff --git a/mypy_self_check.ini b/mypy_self_check.ini index 0b49b3de862b..07c1aef99179 100644 --- a/mypy_self_check.ini +++ b/mypy_self_check.ini @@ -12,5 +12,4 @@ exclude = mypy/typeshed/|mypyc/test-data/|mypyc/lib-rt/ enable_error_code = ignore-without-code,redundant-expr enable_incomplete_feature = PreciseTupleTypes show_error_code_links = True -warn_unreachable = True fixed_format_cache = True