Skip to content

Commit

Permalink
Disable warn_unused_ignores again (pytorch#60480)
Browse files Browse the repository at this point in the history
Summary:
Fixes pytorch#60006 (comment).

Pull Request resolved: pytorch#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
  • Loading branch information
samestep authored and facebook-github-bot committed Jun 22, 2021
1 parent 6a87e8d commit f42140c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/lint_native_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
5 changes: 4 additions & 1 deletion mypy-strict.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down

0 comments on commit f42140c

Please sign in to comment.