Cannot set `output` in `mypy.ini`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
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.
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
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 56
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.
More from python/mypy
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug topic-attrs
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100