From 6d0e370250b8f4f9646c10bcd5b8d6cf302aa418 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 30 Sep 2026 14:34:09 +0200 Subject: [PATCH] Render underscore and bold console tags in reports Bump entropy/entropy to ^0.4.18, which adds and support to OutputColorizer, and stop stripping those tags in EasyCodingStandardStyle so the Applied checkers header and numbered file lines render underlined/bold, matching the blink engine. --- composer.json | 2 +- src/Console/Style/EasyCodingStandardStyle.php | 3 --- tests/Console/Style/EasyCodingStandardStyleTest.php | 7 ++++++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 33febc7983..264cbe76eb 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "clue/ndjson-react": "^1.3", "composer/pcre": "^3.4", "composer/xdebug-handler": "^3.0.5", - "entropy/entropy": "^0.4.15", + "entropy/entropy": "^0.4.18", "fidry/cpu-core-counter": "^1.3", "friendsofphp/php-cs-fixer": "^3.95.20", "nette/utils": "^4.1", diff --git a/src/Console/Style/EasyCodingStandardStyle.php b/src/Console/Style/EasyCodingStandardStyle.php index e3b1bc1289..2345eb4b3b 100644 --- a/src/Console/Style/EasyCodingStandardStyle.php +++ b/src/Console/Style/EasyCodingStandardStyle.php @@ -109,9 +109,6 @@ public function printErrors(array $codingStandardErrors): void */ private function normalizeTags(string $text): string { - // drop bold/underscore styling, keep the text - $text = (string) preg_replace('#]+>(.*?)#su', '$1', $text); - // → yellow, → green $text = (string) preg_replace('#(.*?)#su', '$1', $text); $text = (string) preg_replace('#(.*?)#su', '$1', $text); diff --git a/tests/Console/Style/EasyCodingStandardStyleTest.php b/tests/Console/Style/EasyCodingStandardStyleTest.php index 574a81d457..0c36f198ac 100644 --- a/tests/Console/Style/EasyCodingStandardStyleTest.php +++ b/tests/Console/Style/EasyCodingStandardStyleTest.php @@ -48,7 +48,12 @@ public static function provideData(): Iterator yield 'info tag becomes green' => ['done', 'done']; - yield 'bold options are stripped, text kept' => ['title', 'title']; + yield 'bold options pass through to colorizer' => ['title', 'title']; + + yield 'underscore options pass through to colorizer' => [ + 'Applied checkers:', + 'Applied checkers:', + ]; yield 'explicit color closing tag is normalized' => ['err', 'err'];