diff --git a/docs/source/command_line.rst b/docs/source/command_line.rst index b455e287017e..98a2a927689b 100644 --- a/docs/source/command_line.rst +++ b/docs/source/command_line.rst @@ -754,9 +754,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 7bd7215bbe2a..1aeb78842468 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -825,7 +825,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 816e6321c06f..8b38cf7534a0 100644 --- a/mypy_self_check.ini +++ b/mypy_self_check.ini @@ -13,7 +13,3 @@ 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 - -[mypy-mypy.*] -# TODO: enable for `mypyc` and other files as well -warn_unreachable = True