-
-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to use relative file paths in report #963
Comments
Also: thanks for the great package! |
I think this issue describes the problem I am having too. I reached for
I would love to find a way to chop off everything left of and including the |
This problem also happened in the html report |
pyproject.toml: Set specific source for `toolscoverage.paths` (as we only provide one module). Set `tools.coverage.run.relative_files` to true (although it is still bug riddled and does not seem to work as advertized in regards to xml output: nedbat/coveragepy#963, nedbat/coveragepy#1147). Set `tool.coverage.xml.output`, so we don't have to provide it on the commandline. Makefile: Do not provide an output file to the coverage xml call, as we do that in configuration now.
See also #277. |
Is it enough to use the relative file as stored? |
I think so. But where are they stored? I cannot find any relative paths in the data file. I'm running 6.1.1 on Python 3.10.0 via
with |
pyproject.toml: Set specific source for `toolscoverage.paths` (as we only provide one module). Set `tools.coverage.run.relative_files` to true (although it is still bug riddled and does not seem to work as advertized in regards to xml output: nedbat/coveragepy#963, nedbat/coveragepy#1147). Set `tool.coverage.xml.output`, so we don't have to provide it on the commandline. Makefile: Do not provide an output file to the coverage xml call, as we do that in configuration now.
pyproject.toml: Set specific source for `toolscoverage.paths` (as we only provide one module). Set `tools.coverage.run.relative_files` to true (although it is still bug riddled and does not seem to work as advertized in regards to xml output: nedbat/coveragepy#963, nedbat/coveragepy#1147). Set `tool.coverage.xml.output`, so we don't have to provide it on the commandline. Makefile: Do not provide an output file to the coverage xml call, as we do that in configuration now.
Would this account for |
As others have already noted, this applies to the |
Is your feature request related to a problem? Please describe.
The new
relative_files
config options toggle whether relative paths are stored in the data files, and also how they're reported in XML reports. However, file paths are still absolute in the CLI report (i.e. the one shown withcoverage report
).Describe the solution you'd like
A possibility to have the CLI report respect
relative_files
and show relative paths, either by default or through a toggle.Describe alternatives you've considered
Using
sed
to remove the prefix in reported file paths.Additional context
Related issue: #948.
The text was updated successfully, but these errors were encountered: