Conversation
- change to sprintf formatted strings - use class constant - use helper class for pluralization logic
chore(deps): update all non-major dependencies
There was a problem hiding this comment.
Pull request overview
This pull request enhances the SummaryWriter class to provide more detailed and user-friendly error reporting with color-coded output, grouped error statistics, and helpful informational notes about error categories.
Changes:
- Added tracking of files per identifier and unique files affected across all errors
- Enhanced error summary output with color coding (green for ignorable errors, red for standard errors)
- Added a comprehensive summary section showing total errors, error categories, and affected files with helpful icons and formatting
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/ErrorFormat/SummaryWriter.php
Outdated
| $output->writeLineFormatted('───────────'); | ||
|
|
||
| $output->writeLineFormatted(\sprintf('❌ Found <fg=red>%d</> errors', $analysisResult->getTotalErrorsCount())); | ||
| $output->writeLineFormatted(\sprintf('🏷️ In <fg=red>%d</> error categories', \count($errorCounter))); |
There was a problem hiding this comment.
The emoji "🏷️" has an extra space after it compared to the other lines (lines 66 and 68 which use "❌" and "📂" respectively). This creates inconsistent spacing in the output formatting. Remove the extra space to maintain consistent alignment with the other summary lines.
Suggested change
| $output->writeLineFormatted(\sprintf('🏷️ In <fg=red>%d</> error categories', \count($errorCounter))); | |
| $output->writeLineFormatted(\sprintf('🏷️ In <fg=red>%d</> error categories', \count($errorCounter))); |
Add baseline.neon with unmatched errors to show: - 🎉 ignore.unmatched errors - 🚨 non-ignorable errors
- Add error breakdown tree showing "to fix" vs "can be removed from baseline" - Add "cannot be ignored by baseline" count for non-ignorable errors - Use text-based messaging instead of color-coded meaning - Change "error categories" to "error identifiers" for consistency
Changes: - Use 🏷️ emoji for identifier display (unified across error details and summary) - Update tree item wording to match original PR style: - "can be removed after updating the baseline" - "have no identifier, consider upgrading to PHPStan v2" - Keep colors minimal - only gray for supplementary info like file counts - Update tests to match new output format Design principle: Colors should enhance readability, not carry meaning. CI environments often disable colors, so all information must be conveyed through text alone.
Use getTraitFilePath() ?? getFilePath() to match ErrorWriter behavior, ensuring file counts are accurate when errors occur in traits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the error summary output in
SummaryWriterby providing more detailed, user-friendly, and color-coded reporting of analysis errors. The changes improve clarity by grouping errors by identifier, showing how many files are affected, and adding a summary section with helpful notes.Improvements to error summary output:
Supporting code changes:
getFileSuffixwas introduced to correctly pluralize the word "file" in the summary output.