Add coverage options for hatch-test scripts
It has been a very educational experience following the documentation of hatch to update my setup.py-style projects to follow the latest best-practices. Thank you @ofek for all the time you spend developing helpful tools.
This PR is in regards to the hatch test command that was added in version 1.10.0.
While converting a project that used the coverage html command, I needed to redefine all scripts in the [envs.hatch-test.scripts] table even though I used the default run, run-cov and cov-combine scripts, e.g.,
[envs.hatch-test.scripts]
run = "pytest{env:HATCH_TEST_ARGS:} {args}" # default
run-cov = "coverage run -m pytest{env:HATCH_TEST_ARGS:} {args}" # default
cov-combine = "coverage combine" # default
cov-report = "coverage html" # replaced 'report' with 'html'
This PR proposes that the following options may be defined in the [envs.hatch-test] table
combine-args: array of strings, for thecov-combinescriptreporting: string, for thecov-reportscriptreporting-args: array of strings, for thecov-reportscript
so that, for my particular use case, I could now define the [envs.hatch-test] table as
[envs.hatch-test]
reporting = "html"
Another example. Suppose someone wants to silence all messages from coverage combine and show the lines that were excluded in the tests when reporting
[envs.hatch-test]
combine-args = ["--quiet"]
reporting-args = ["--show-missing"]
Thanking you for any comments or suggestions you may have. No worries if this PR does not align with the way you want hatch-test.scripts to be used ‐ feel free to close it.
I will check this out in the coming weeks, thanks!!!