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

Fix: Pad lines in code coverage report only when colors are shown #1032

Merged
merged 2 commits into from
Mar 9, 2024

Conversation

localheinz
Copy link
Contributor

@localheinz localheinz commented Mar 9, 2024

This pull request

  • pads lines in code coverage report only when colors are shown

Copy link

codecov bot commented Mar 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.90%. Comparing base (842f726) to head (c06fe6c).

Additional details and impacted files
@@             Coverage Diff              @@
##               10.1    #1032      +/-   ##
============================================
+ Coverage     84.03%   84.90%   +0.87%     
  Complexity     1199     1199              
============================================
  Files            71       71              
  Lines          4252     4253       +1     
============================================
+ Hits           3573     3611      +38     
+ Misses          679      642      -37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@localheinz localheinz force-pushed the fix/padding branch 2 times, most recently from 29d5e6b to 2a87404 Compare March 9, 2024 14:49
Comment on lines 307 to 304
private function format(string $color, int $padding, false|string $string): string
private function format(string $color, false|string $string): string
{
$reset = $color ? self::COLOR_RESET : '';

return $color . str_pad((string) $string, $padding) . $reset . PHP_EOL;
return $color . (string) $string . $reset . PHP_EOL;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dvdoug

Do you remember what purpose the padding serves here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dvdoug

A quick conversation with @sebastianbergmann confirms that this is used for rendering blocks

Before

CleanShot 2024-03-09 at 15 54 03@2x

After

CleanShot 2024-03-09 at 15 54 32@2x

Copy link
Contributor

Choose a reason for hiding this comment

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

It's ancient from sebastianbergmann/phpunit#949

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, @dvdoug!

@localheinz localheinz changed the title Fix: Do not pad lines of code coverage report Fix: Pad lines in code coverage report only when colors are shown Mar 9, 2024
@sebastianbergmann sebastianbergmann merged commit aa7e0c8 into sebastianbergmann:10.1 Mar 9, 2024
20 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.

3 participants