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

Configuration file recognizes dash as correct but results in broken config #4753

Closed
chingc opened this Issue Mar 17, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@chingc

chingc commented Mar 17, 2018

mypy doesn't seem to be able to recognize dashed-options as incorrect within the context of a config file.

For example, suppose we have the following files nothing.py and mypy.ini

def nothing():
    pass
[mypy]
X = True

When X is:

  • disallow_untyped_defs
    • Correctly reports nothing.py:1: error: Function is missing a type annotation
  • disallow_untyped_defs1
    • Correctly reports: mypy.ini: [mypy]: Unrecognized option: disallow_untyped_defs1 = True
  • disallow-untyped-defs
    • Doesn't tell me I'm missing a type annotation, nor that the option is incorrect. No errors at all!

Python 3.6.4 and mypy 0.570 were used.

@gvanrossum

This comment has been minimized.

Member

gvanrossum commented Mar 17, 2018

Good observation! Can you dig in the source to see what's wrong? Something is presumably normalizing the dashes to underscore, but something else doesn't seem to use the normalized version...

gvanrossum added a commit that referenced this issue Mar 19, 2018

Only allow snake_case keys in configuration file (#4754)
Stop translating dashes to underscores in config file keys; it never worked right.

Fixes #4753.
@chingc

This comment has been minimized.

chingc commented Mar 19, 2018

Wow, I wasn't expecting such a quick response and fix. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment