Skip to content

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

@KotlinIsland

Description

@KotlinIsland
# 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-configurationConfiguration files and flags

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions