From f42140cb8a183876adaa58ffc6a7d85da9dada7c Mon Sep 17 00:00:00 2001 From: Sam Estep Date: Tue, 22 Jun 2021 12:37:32 -0700 Subject: [PATCH] Disable warn_unused_ignores again (#60480) Summary: Fixes https://github.com/pytorch/pytorch/pull/60006#issuecomment-866130657. Pull Request resolved: https://github.com/pytorch/pytorch/pull/60480 Test Plan: Run `mypy --config mypy-strict.ini` with [`ruamel.yaml`](https://pypi.org/project/ruamel.yaml/) installed. Reviewed By: zhouzhuojie Differential Revision: D29307823 Pulled By: samestep fbshipit-source-id: 97fa4b7dad0465c269411c48142b22ce751bf830 --- .github/scripts/lint_native_functions.py | 2 +- mypy-strict.ini | 5 ++++- mypy.ini | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/scripts/lint_native_functions.py b/.github/scripts/lint_native_functions.py index 86a31615de6..2e6d4e3e767 100755 --- a/.github/scripts/lint_native_functions.py +++ b/.github/scripts/lint_native_functions.py @@ -26,7 +26,7 @@ def fn(base: str) -> str: with open(Path(__file__).parent.parent.parent / fn('.'), "r") as f: contents = f.read() -yaml = ruamel.yaml.YAML() +yaml = ruamel.yaml.YAML() # type: ignore[attr-defined] yaml.preserve_quotes = True yaml.width = 1000 yaml.boolean_representation = ['False', 'True'] diff --git a/mypy-strict.ini b/mypy-strict.ini index 5d165092287..4c988883fdc 100644 --- a/mypy-strict.ini +++ b/mypy-strict.ini @@ -19,7 +19,6 @@ disallow_any_unimported = True # Across versions of mypy, the flags toggled by --strict vary. To ensure # we have reproducible type check, we instead manually specify the flags warn_unused_configs = True -warn_unused_ignores = True disallow_any_generics = True disallow_subclassing_any = True disallow_untyped_calls = True @@ -33,6 +32,10 @@ warn_return_any = True implicit_reexport = False strict_equality = True +# do not reenable this: +# https://github.com/pytorch/pytorch/pull/60006#issuecomment-866130657 +warn_unused_ignores = False + files = .github, benchmarks/instruction_counts, diff --git a/mypy.ini b/mypy.ini index efacfae88be..9ad9600d814 100644 --- a/mypy.ini +++ b/mypy.ini @@ -6,13 +6,16 @@ plugins = mypy_plugins/check_mypy_version.py cache_dir = .mypy_cache/normal warn_unused_configs = True -warn_unused_ignores = True warn_redundant_casts = True show_error_codes = True show_column_numbers = True check_untyped_defs = True follow_imports = silent +# do not reenable this: +# https://github.com/pytorch/pytorch/pull/60006#issuecomment-866130657 +warn_unused_ignores = False + # # Note: test/ still has syntax errors so can't be added #