-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Fix: Pad lines in code coverage report only when colors are shown #1032
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
29d5e6b
to
2a87404
Compare
src/Report/Text.php
Outdated
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you remember what purpose the padding serves here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick conversation with @sebastianbergmann confirms that this is used for rendering blocks
Before
After
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @dvdoug!
This pull request