Specify filepath in `cobertura_xml_report`, instead of folder
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Feature
Currently, the cobertura_xml_report is used as folder path, in which mypy typically only produces a single file cobertura.xml.
I would like to be able to specify a direct output path of the xml file, without having additional folders produced.
Pitch
Using the xml report in a CI requires additional config to archive an extra folder, which is unneeded if a target file can be specified.
Even when specifying something like cobertura_xml_report = "mypy.xml", the output file is still mypy.xml/cobertura.xml.
A potential workaround --cobertura-xml-report=. is unsafe because mypy simply overwrites any cobertura.xml produced by any other tool.
If the use case is too different from the other reporting outputs which all use DIR, please consider allowing this option via toml config.
For instance, something like this:
[tool.mypy]
cobertura_xml_report = {file = "mypy.xml"}
html_report = {dir = "mypy"}
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 tracing how mypy handles the cobertura_xml_report option and how its other reporting outputs interpret paths. Compare the requested direct file path with the existing folder behavior and the proposed TOML file/dir distinction. Done means a configured XML filename is written directly without an extra folder, while the existing directory behavior remains clear and safe.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100