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

chingc opened this Issue Mar 17, 2018 · 2 comments


None yet
2 participants

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 and mypy.ini

def nothing():
X = True

When X is:

  • disallow_untyped_defs
    • Correctly reports 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.


This comment has been minimized.


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.

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