-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/summary improvement #1
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
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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))); |
Copilot
AI
Jan 21, 2026
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.
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.
| $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 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.