Skip to content

Fix issue #17: Dynamic color mapping for "fail-on" messages/categories in ColorizedTextReporter #19

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

snipr-ben
Copy link

This pull request fixes #17.

The issue has been successfully resolved. The PR made the following key changes:

  1. Modified the ColorizedTextReporter to accept a linter instance in its constructor and dynamically update color mapping based on the linter's fail_on_symbols attribute.

  2. Added a new method _update_color_mapping that applies the same styling (red + bold) to custom fail-on symbols as used for error messages.

  3. Updated the reporter registration to pass the linter instance to the ColorizedTextReporter.

These changes ensure that:

  • Custom fail-on messages will now be displayed with the same visual prominence as error messages (red + bold)
  • The solution works with any custom fail-on configuration
  • The implementation maintains backward compatibility
  • The coloring is applied consistently regardless of whether the fail-on symbols are default or custom

The solution directly addresses the original issue by making custom fail-on messages stand out in CI logs, eliminating the need for manual workarounds. The implementation provides the dynamic behavior requested in the original issue description.

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.

Dynamic color mapping for "fail-on" messages/categories in ColorizedTextReporter
1 participant