Skip to content

Commit

Permalink
Don't warn about unrecognized options starting with 'x_' (#4522)
Browse files Browse the repository at this point in the history
Fixes #4521
  • Loading branch information
gvanrossum authored and ilevkivskyi committed Jan 30, 2018
1 parent 73e58da commit d2c0419
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,8 @@ def parse_section(prefix: str, template: Options,
print("%s: Unrecognized report type: %s" % (prefix, orig_key),
file=sys.stderr)
continue
if key.startswith('x_'):
continue # Don't complain about `x_blah` flags
print("%s: Unrecognized option: %s = %s" % (prefix, key, section[orig_key]),
file=sys.stderr)
continue
Expand Down
8 changes: 8 additions & 0 deletions test-data/unit/cmdline.test
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,14 @@ ignore_missing_imports = True
[out]
main.py:2: error: Revealed type is 'Any'

[case testConfigNoErrorForUnknownXFlagInSubsection]
# cmd: mypy -c pass
[file mypy.ini]
[[mypy]
[[mypy-foo]
x_bad = 0
[out]

[case testDotInFilenameOKScript]
# cmd: mypy a.b.py c.d.pyi
[file a.b.py]
Expand Down

0 comments on commit d2c0419

Please sign in to comment.