Skip to content

Conversation

@MatuzMark
Copy link
Owner

This pull request enhances the error summary output in SummaryWriter by 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:

  • The summary now displays the number of errors per identifier, the number of files affected for each identifier, and uses color coding to distinguish between ignorable and non-ignorable errors. [1] [2]
  • A new summary section at the end shows total errors, the number of error categories, and the total number of affected files, with clear formatting and icons for readability.
  • Informational notes are added to highlight errors that can be removed by updating the baseline, errors without identifiers (with a suggestion to upgrade), and errors that cannot be ignored by the baseline.

Supporting code changes:

  • Internal counters and file tracking were added to support the new summary features, including tracking unique files and non-ignorable errors.
  • A helper method getFileSuffix was introduced to correctly pluralize the word "file" in the summary output.

MatuzMark and others added 4 commits January 8, 2026 09:00
Copy link

Copilot AI left a 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.

$output->writeLineFormatted('───────────');

$output->writeLineFormatted(\sprintf('❌ Found <fg=red>%d</> errors', $analysisResult->getTotalErrorsCount()));
$output->writeLineFormatted(\sprintf('🏷️ In <fg=red>%d</> error categories', \count($errorCounter)));
Copy link

Copilot AI Jan 21, 2026

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.

Suggested change
$output->writeLineFormatted(\sprintf('🏷️ In <fg=red>%d</> error categories', \count($errorCounter)));
$output->writeLineFormatted(\sprintf('🏷️ In <fg=red>%d</> error categories', \count($errorCounter)));

Copilot uses AI. Check for mistakes.
MatuzMark and others added 7 commits January 22, 2026 00:03
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants