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

(🐞) Invalid per-module options in inline configuration are silently ignored #12342

Open
KotlinIsland opened this issue Mar 13, 2022 · 0 comments
Labels
bug mypy got something wrong topic-configuration Configuration files and flags

Comments

@KotlinIsland
Copy link
Contributor

KotlinIsland commented Mar 13, 2022

# mypy: disable-error-code=name-defined python-verion="3.6"

a  # error: Name "a" is not defined  [name-defined]

But if I include it in the config file it gives a warning:

[[tool.mypy.overrides]]
module  = ["test"]
disable_error_code = "name-defined"
python_verion="3.6"
> mypy test.py
pyproject.toml: [module = "test"]: Per-module sections should only specify per-module flags (disable_error_code, python_version)
test.py:3:1: error: Name "a" is not defined  [name-defined]
Found 1 error in 1 file (checked 1 source file)

This is inconsistent with having a invalid option inline:

# mypy: AMONGUS
> mypy test.py
test.py:1:1: error: Unrecognized option: amongus = True  [misc]
Found 1 error in 1 file (checked 1 source file)
@KotlinIsland KotlinIsland added the bug mypy got something wrong label Mar 13, 2022
@JelleZijlstra JelleZijlstra added the topic-configuration Configuration files and flags label Mar 19, 2022
@KotlinIsland KotlinIsland changed the title (🐞) disable-error-code doesn't work in inline configuration (🐞) Invalid per-module options in inline configuration are silently ignored Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-configuration Configuration files and flags
Projects
None yet
Development

No branches or pull requests

2 participants