Dmypy ignoring aditional section names on config file
Open
Nobody has claimed this yet.
bug
topic-configuration
topic-daemon
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Bug Report
Running dmypy as
python -m mypy.dmypy --status-file '...' run -- src/ --show-column-numbers --no-error-summary --no-pretty --no-color-output --config-file mypy.ini --python-executable
with a mypy.ini with the following config:
[mypy]
files = sales_register/
python_version = 3.9
ignore_missing_imports = True
follow_imports = skip
plugins = pydantic.mypy
local_partial_types = False
[mypy-adapters.repositories.postgres.migrations.*]
ignore_errors = True
are not ignoring errors in src/adapters/repositories/postgres/migrations/ files. Running just mypy --config-file=mypy.ini works fine.
To Reproduce
- Create a
srcfolder, and asrc/afolder inside - Create a
test.pyfile insidesrc/awith the following code:
def a(x: str) -> str:
return x
b: int = a('1') # Obviously mypy should raise something here
- Create a
mypy.inifile withignore_errors=Truein[mypy-a.*]to skip error in thesrc/a/test.pyfile - Runs
python -m mypy.dmypy --status-file '...' run -- src/ --show-column-numbers --no-error-summary --no-pretty --no-color-output --config-file mypy.ini --python-executable
Expected Behavior
Shouldnt raise any error
Actual Behavior
Raising TypeError
Your Environment
- Mypy version used: 0.812
- Python version used: 3.9
- Operating system and version: macOS 11.3.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
Start by reproducing the issue with python -m mypy.dmypy, the shown mypy.ini, and the src/a/test.py example, then compare it with mypy --config-file=mypy.ini. Trace how the dmypy entry point handles additional config sections; done means the [mypy-a.*] setting suppresses the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100