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

(🐞) error code that is enabled in the config file can't be disabled on the CLI (with --disable-error-code) #16628

Open
KotlinIsland opened this issue Dec 7, 2023 · 0 comments
Labels
bug mypy got something wrong topic-configuration Configuration files and flags

Comments

@KotlinIsland
Copy link
Contributor

KotlinIsland commented Dec 7, 2023

I think it would be intuitive for commandline arguments to override config file options, but the way that enable/disable-error-code works isn't.

pyproject.toml

[tool.mypy]
enable_error_code = "operator"
> mypy --disable-error-code operator -c "1 + ''"
test.py:1: error: Unsupported operand types for + ("int" and "str")  [operator]
Found 1 error in 1 file (checked 1 source file)

The docs specify how these flags interact with themselves, but don't mention the ones in the config file.

--enable-error-code
This flag allows enabling one or multiple error codes globally. See [Error codes](https://mypy.readthedocs.io/en/stable/error_codes.html#error-codes) for more information.

Note: This flag will override disabled error codes from the [--disable-error-code](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-disable-error-code) flag.
@KotlinIsland KotlinIsland added the bug mypy got something wrong label Dec 7, 2023
@AlexWaygood AlexWaygood added the topic-configuration Configuration files and flags label Dec 7, 2023
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