Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't warn about unrecognized options starting with 'x_' #4522

Merged
merged 1 commit into from
Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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