Skip to content

Dynamic color mapping for "fail-on" messages/categories in ColorizedTextReporter #17

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
zchn opened this issue Apr 27, 2025 · 4 comments · May be fixed by #18 or #19
Open

Dynamic color mapping for "fail-on" messages/categories in ColorizedTextReporter #17

zchn opened this issue Apr 27, 2025 · 4 comments · May be fixed by #18 or #19

Comments

@zchn
Copy link

zchn commented Apr 27, 2025

Current problem

The ColorizedTextReporter (--output-format=colorized) makes it easy in CI jobs to find the failure causing pylint errors quickly.
Especially when there are more than a few unfixed pylint findings.
But if the configuration for fail-on differs from the default value, e.g. additional message types have been added to fail-on, these are not highlighted in red and are therefore more difficult to find in the CI log.

Desired solution

I suggest more dynamic message coloring for custom fail-on configs.
For example if a whole category or single message type is configured as fail-on, then color it the same as Error or Failure message category. Or perhaps a completely new color (e.g. red inverse) that represents all fail-on messages/categories?

Additional context

My current workaround is a custom reporter class. But since the reporter class currently has no access to the linter variable self.fail_on_symbols, only hardcoded color codes for extra message types are possible.

@zchn
Copy link
Author

zchn commented Apr 27, 2025

original issue number is 9898

@zchn
Copy link
Author

zchn commented Apr 27, 2025

@snipr-ben snipe it thank you

snipr-ben pushed a commit that referenced this issue Apr 27, 2025
@snipr-ben
Copy link

Pull request created: #18

@snipr-ben
Copy link

Pull request created: #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants