Skip to content

Allow strict in config, explicitly disallow inline #8192

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

Merged
merged 2 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Improve strict not supported in inline config error message
  • Loading branch information
scop committed Jan 19, 2020
commit c32dfe52cc1e01d12fb10e74eda083effa0412a4
6 changes: 5 additions & 1 deletion mypy/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,11 @@ def set_strict_flags() -> None:
if reports:
errors.append((lineno, "Reports not supported in inline configuration"))
if strict_found:
errors.append((lineno, "Setting 'strict' not supported in inline configuration"))
errors.append((lineno,
"Setting 'strict' not supported in inline configuration: specify it in "
"a configuration file instead, or set individual inline flags "
"(see 'mypy -h' for the list of flags enabled in strict mode)"))

sections.update(new_sections)

return sections, errors
2 changes: 1 addition & 1 deletion test-data/unit/check-inline-config.test
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ main:1: error: Unrecognized option: skip_file = True
[case testInlineStrict]
# mypy: strict
[out]
main:1: error: Setting 'strict' not supported in inline configuration
main:1: error: Setting 'strict' not supported in inline configuration: specify it in a configuration file instead, or set individual inline flags (see 'mypy -h' for the list of flags enabled in strict mode)