mypy: Assign warn_unreachable in mypy.ini.

Instead of doing this rather clumsily in `run_mypy`,
we configure the option in `mypy.ini`.
This commit is contained in:
Wyatt Hoodes 2019-08-02 14:16:06 -10:00 committed by Tim Abbott
parent ac69717604
commit 8c26183c65
2 changed files with 2 additions and 6 deletions

View File

@ -35,6 +35,8 @@ follow_imports = error
# This doesn't get in the way of using the stubs we *do* have. # This doesn't get in the way of using the stubs we *do* have.
ignore_missing_imports = True ignore_missing_imports = True
# Warn of unreachable or redundant code.
warn_unreachable = True
# #
# #

View File

@ -36,10 +36,6 @@ parser.add_argument('-a', '--all', action='store_true',
help="check all files, bypassing the default exclude list") help="check all files, bypassing the default exclude list")
parser.add_argument('--force', action="store_true", parser.add_argument('--force', action="store_true",
help="run tests despite possible provisioning problems") help="run tests despite possible provisioning problems")
parser.add_argument('--warn-unreachable',
action='store_false',
default=True,
help="warn of unreachable or redundant code; defaults to true")
args = parser.parse_args() args = parser.parse_args()
assert_provisioning_status_ok(args.force) assert_provisioning_status_ok(args.force)
@ -77,8 +73,6 @@ if not python_files and not pyi_files:
extra_args = [] extra_args = []
if args.quick: if args.quick:
extra_args.append("--quick") extra_args.append("--quick")
elif args.warn_unreachable:
extra_args.append("--warn-unreachable")
mypy_args = extra_args + python_files + pyi_files mypy_args = extra_args + python_files + pyi_files
if args.no_daemon: if args.no_daemon: