Skip to content
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

Shorten module names in html report #116

Open
nedbat opened this issue Feb 2, 2011 · 1 comment
Open

Shorten module names in html report #116

nedbat opened this issue Feb 2, 2011 · 1 comment
Labels
enhancement New feature or request html

Comments

@nedbat
Copy link
Owner

nedbat commented Feb 2, 2011

Originally reported by Ram Rachum (Bitbucket: coolrr, GitHub: coolrr)


I have some long module names in my project.

This is making my html report too wide, which makes it hard to read in a browser because of horizontal scrolling:

{{http://i.imgur.com/NBt2s.png|screenshot}}

I would like coverage to put a '...' in the middle of long modules' names in order to shorten them. Or any other reasonable way of shortening their names to make for an easy-to-read html report. Also note that this screenshot was taken on a 1280*1024 monitor; I want to be able to see coverage reports on smaller monitors too, if possible.

A few ideas: We can put the numbers to the left of the names. We could use a smaller font for the names.


@nedbat
Copy link
Owner Author

nedbat commented Aug 2, 2017

Original comment by Vitaly Bogomolov (Bitbucket: vb, GitHub: Unknown)


Maybe, something like this:

#!ini

[coverage:report]
path_prefix = /very/long/path/name

#!python

if path_prefix and module_name.startswith(path_prefix):
    output_name = module_name[len(path_prefix):]

path_prefix value can be shown once on the report page.
both 'report' and 'html' commands can be a target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request html
Projects
None yet
Development

No branches or pull requests

1 participant