Cannot set `output` in `mypy.ini`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Bug Report
The following config is not respected:
[mypy]
output = json
I believe this is as mypy.config_parser.parse_section() does dv = getattr(template, key, None); if dv is None: ..., but the default of Options.output is intentionally None. I don't know if excluding None default values is intentional here or not, so I haven't yet put up a PR until someone can confirm.
To Reproduce
Use the above config, observe output is not JSON.
Expected Behavior
To be able to configure the output format via JSON.
Actual Behavior
No JSON.
Your Environment
- Mypy version used: 1.20.2
- Mypy command-line flags: None
- Mypy configuration options from
mypy.ini(and other config files): As above - Python version used: 3.12
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 with mypy.config_parser.parse_section() and inspect how it handles the None default of Options.output. Reproduce the issue using the shown mypy.ini configuration, then verify that configuring output produces JSON as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100