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

Add interface to specify custom.css file for HTML report #901

Closed
wants to merge 1 commit into from

Conversation

hemberger
Copy link
Contributor

Related to #556.

It would help to make the custom CSS feature more accessible by making
the file a configuration option, e.g. in phpunit:

<coverage>
    <report>
        <html customCssFile="path/to/custom.css" />
    </report>
</coverage>

The $customCssFile argument is added to the Html\Facade interface as
a prerequisite to any changes to phpunit configuration options. If not
null, it copies this file to the custom.css destination instead of the
empty custom.css stub file.


A couple logistical notes:

  1. There wasn't an obvious way to add a good test for this feature. If there's something specific you'd like to see tested, I'm more than happy to add it.
  2. If you're on board with this plan, I can also put together a PR in phpunit to add the configuration option. Is there any protocol for adding features to phpunit that depend on a specific version of php-code-coverage?

Thanks for your time!

Related to sebastianbergmann#556.

It would help to make the custom CSS feature more accessible by making
the file a configuration option, e.g. in phpunit:

    <coverage>
        <report>
            <html customCssFile="path/to/custom.css" />
        </report>
    </coverage>

The `$customCssFile` argument is added to the Html\Facade interface as
a prerequisite to any changes to phpunit configuration options. If not
null, it copies this file to the custom.css destination instead of the
empty custom.css stub file.
@codecov
Copy link

codecov bot commented Feb 21, 2022

Codecov Report

Merging #901 (4ebadcd) into 9.2 (75a0f91) will increase coverage by 2.36%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                9.2     #901      +/-   ##
============================================
+ Coverage     83.37%   85.74%   +2.36%     
- Complexity     1127     1550     +423     
============================================
  Files            59       61       +2     
  Lines          3237     4741    +1504     
============================================
+ Hits           2699     4065    +1366     
- Misses          538      676     +138     
Impacted Files Coverage Δ
src/Report/Html/Facade.php 94.79% <100.00%> (+1.14%) ⬆️
src/Node/Builder.php 96.61% <0.00%> (-0.80%) ⬇️
src/Report/Html/Renderer.php 98.90% <0.00%> (-0.25%) ⬇️
src/Version.php 100.00% <0.00%> (ø)
src/CrapIndex.php 83.33% <0.00%> (ø)
src/Percentage.php 100.00% <0.00%> (ø)
src/Node/Iterator.php 75.00% <0.00%> (ø)
src/Driver/Selector.php 0.00% <0.00%> (ø)
src/Report/Xml/File.php 100.00% <0.00%> (ø)
src/Report/Xml/Node.php 100.00% <0.00%> (ø)
... and 30 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75a0f91...4ebadcd. Read the comment docs.

@hemberger hemberger changed the base branch from master to 9.2 February 21, 2022 23:11
@sebastianbergmann
Copy link
Owner

Thank you for your contribution. I appreciate the time you invested in preparing this pull request. However, I have decided not to merge it.

I think that this should be handled outside of php-code-coverage (and PHPUnit). Your build automation should copy your custom.css to the css directory in the generated directory.

@sebastianbergmann
Copy link
Owner

Meditate on this, I shall.

@sebastianbergmann
Copy link
Owner

Superseded by cd4b129.

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