Merge pull request #919 from WendellAdriel/feature/coverage-errors-only-flag-2

[2.x] Print only files below the min coverage
This commit is contained in:
Nuno Maduro
2023-12-17 21:56:14 +00:00
committed by GitHub
3 changed files with 43 additions and 3 deletions

View File

@ -74,7 +74,7 @@ final class Coverage
* Reports the code coverage report to the
* console and returns the result in float.
*/
public static function report(OutputInterface $output): float
public static function report(OutputInterface $output, float $coverageMin, bool $showErrorsOnly): float
{
if (! file_exists($reportPath = self::getPath())) {
if (self::usingXdebug()) {
@ -126,6 +126,10 @@ final class Coverage
$truncateAt = max(1, terminal()->width() - 12);
if ($showErrorsOnly && (float) $percentage >= $coverageMin) {
continue;
}
renderUsing($output);
render(<<<HTML
<div class="flex mx-2">