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

Conversation

scop
Copy link
Contributor

@scop scop commented Dec 22, 2019

No description provided.

@msullivan
Copy link
Collaborator

What's the rationale for explicitly disallowing in inline configuration?

@scop
Copy link
Contributor Author

scop commented Jan 19, 2020

Mainly to fix the current situation: specifying it inline doesn't work, and ends up displaying a misleading error message about configuration files (not inline config), currently:

$ cat /tmp/x.py 
# mypy: strict
$ python mypy /tmp/x.py 
/tmp/x.py:1: error: Strict mode is not supported in configuration files: specify individual flags instead (see 'mypy -h' for the list of flags enabled in strict mode)
Found 1 error in 1 file (checked 1 source file)

After:

$ python mypy /tmp/x.py 
/tmp/x.py:1: error: Setting 'strict' not supported in inline configuration

If I remember correctly, making it work for inline config would not have been a quick fix. The details escape me at the moment.

Anyway, the rubber duck tells me that I should improve that message somewhat though; rebase and improvement coming in a jiffy.

@scop scop force-pushed the strict-in-config branch from 73a3532 to c32dfe5 Compare January 19, 2020 11:00
@msullivan msullivan merged commit cb0ceb0 into python:master Feb 21, 2020
@scop scop deleted the strict-in-config branch February 21, 2020 21:44
andersk added a commit to andersk/mypy that referenced this pull request Sep 17, 2021
Historically --strict was only supported on the command line, but
commit cb0ceb0 (python#8192) added this
option to the config file in 0.770.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
JelleZijlstra pushed a commit that referenced this pull request Sep 19, 2021
Historically --strict was only supported on the command line, but
commit cb0ceb0 (#8192) added this
option to the config file in 0.770.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants