Hi,
I had a .toml config file working with the following option: html_report = "coverage-diff.html"
It used to work, but now the option is simply ignored.
I suppose it stopped working with the option deprecation.
However, when I try to specify the format option it's also ignored : `format = "html:coverage-diff.html"
Copilot reports the following analysis:
Bug: format key in [tool.diff_cover] TOML config is silently ignored
Version
diff-cover 9.7.1
Description
Setting format in a pyproject.toml / custom .toml config file under
[tool.diff_cover] has no effect. The HTML (or JSON/Markdown) report is never
generated when the option is provided exclusively through the config file.
Steps to Reproduce
-
Create a diff_cover.toml:
[tool.diff_cover]
compare_branch = "origin/develop"
format = "html:coverage/coverage-diff.html"
-
Run:
diff-cover coverage/lcov.info --config-file=diff_cover.toml
-
Observe that only the text report is printed to stdout. coverage/coverage-diff.html is not created.
Expected Behavior
coverage/coverage-diff.html is generated, equivalent to passing
--format html:coverage/coverage-diff.html on the CLI.
Actual Behavior
The format value from the TOML is silently discarded. No HTML file is produced.
Root Cause
In diff_cover_tool.py, --format is registered with a non-None default:
parser.add_argument("--format", type=format_type, default="", ...)
Thanks
Hi,
I had a .toml config file working with the following option:
html_report = "coverage-diff.html"It used to work, but now the option is simply ignored.
I suppose it stopped working with the option deprecation.
However, when I try to specify the format option it's also ignored : `format = "html:coverage-diff.html"
Copilot reports the following analysis:
Bug:
formatkey in[tool.diff_cover]TOML config is silently ignoredVersion
diff-cover 9.7.1
Description
Setting
formatin apyproject.toml/ custom.tomlconfig file under[tool.diff_cover]has no effect. The HTML (or JSON/Markdown) report is nevergenerated when the option is provided exclusively through the config file.
Steps to Reproduce
Create a
diff_cover.toml:Run:
Observe that only the text report is printed to stdout.
coverage/coverage-diff.htmlis not created.Expected Behavior
coverage/coverage-diff.htmlis generated, equivalent to passing--format html:coverage/coverage-diff.htmlon the CLI.Actual Behavior
The
formatvalue from the TOML is silently discarded. No HTML file is produced.Root Cause
In
diff_cover_tool.py,--formatis registered with a non-Nonedefault:Thanks