Overrides in pyproject.toml not excluding specified modules
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
When running mypy with a pyproject.toml configuration that uses the [[tool.mypy.overrides]] section to exclude specific modules, the specified modules are still being type-checked, contrary to expectations.
Steps to Reproduce:
Set up a pyproject.toml with mypy configurations using the [[tool.mypy.overrides]] section to exclude a specific module:
[tool.mypy]
python_version = "3.8"
[[tool.mypy.overrides]]
module = ["test_module.sample"]
ignore_errors = true
Have a sample module with evident type errors:
# test_module/sample.py
def faulty_function() -> int:
return "This should be an integer!"
Run mypy with the provided configuration:
mypy test_module/ --config-file pyproject.toml
Expected Behavior:
The module test_module.sample should be excluded from type-checking and no errors should be reported.
Actual Behavior:
mypy reports type errors from the module test_module.sample, indicating that it is not being excluded as specified in the configuration.
Mypy Version: 1.6.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the shown pyproject.toml configuration and test_module/sample.py, then trace how mypy processes the [[tool.mypy.overrides]] section. Done means test_module.sample is not reported when ignore_errors is true; verify the behavior with the provided mypy command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100