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

Allow passing custom CSS file to html_coverage #56

Merged
merged 5 commits into from
Jul 27, 2024
Merged

Conversation

jagot
Copy link
Contributor

@jagot jagot commented Jul 26, 2024

I added a keyword argument to html_coverage that takes the path to a custom CSS file, to be used as

html_coverage(cov, css="path/to/custom.css")

Using e.g. a CSS file based on the Gruvbox theme, it can look like

image

image

image

image

gruvbox.zip

Copy link
Collaborator

@tpapp tpapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just requested a tiny change, and please add a test. It can be something trivial, eg

  1. you provide a CSS file and then grep for it in the result, and

  2. you provide a bogus argument (eg an integer) and it errors.


See [`generate_coverage`](@ref).
"""
function html_coverage(coverage::PackageCoverage; gitroot = ".", open = false, dir = tempdir())
function html_coverage(coverage::PackageCoverage; gitroot = ".", open = false, dir = tempdir(), css::Union{Nothing,String}=nothing)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function html_coverage(coverage::PackageCoverage; gitroot = ".", open = false, dir = tempdir(), css::Union{Nothing,String}=nothing)
function html_coverage(coverage::PackageCoverage; gitroot = ".", open = false, dir = tempdir(), css::Union{Nothing,AbstractString}=nothing)

@jagot
Copy link
Contributor Author

jagot commented Jul 26, 2024

Thanks for the suggestions!

I added a test for the argument error you suggested, and generation of a coverage report using a dummy CSS file, testing for equality using the FileCmp package as a extra test dependency. Hope that is OK.

Copy link
Collaborator

@tpapp tpapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the very clean code.

@tpapp tpapp merged commit 9a7f571 into JuliaCI:master Jul 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants