Skip to content

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

Open
@felixp98

Description

@felixp98

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement ✨Improvement to a componentHelp wanted 🙏Outside help would be appreciated, good for new contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions