-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Colorize "fail-on" messages/categories in ColorizedTextReporter red inverse #10444
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?
Colorize "fail-on" messages/categories in ColorizedTextReporter red inverse #10444
Conversation
for more information, see https://pre-commit.ci
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.
This look pretty good, without looking too much into it the only problem I see could be adding more to the pylinter. I'd rather have the logic be in the reporter itself, but maybe that's not possible.
Codecov ReportAttention: Patch coverage is
β Your patch check has failed because the patch coverage (73.33%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #10444 +/- ##
==========================================
- Coverage 95.88% 95.86% -0.02%
==========================================
Files 176 176
Lines 19140 19153 +13
==========================================
+ Hits 18352 18361 +9
- Misses 788 792 +4
π New features to boost your workflow:
|
I mean, the logic is in the reporter, but somehow the reporter has to get the configured |
Type of Changes
Description
colorized reporter now colorizes messages/categories that have been configured as
fail-on
in red inverse.This makes it easier to quickly find the errors that are causing pylint CI job failures.
Example
python code to be linted
with following fail-on configuration:
fail-on=E, missing-function-docstring
results in:

Note on the changes
I'm not sure if there is a better way to pass the configured
fail-on
symbols to the ColorizedTextReporter class.At the time at which the constructor of the reporter class is called, the fail_on symbols have not been parsed/converted to specific msgs. Therefore I'm passing the fail_on_symbol list to the reporter afterwards.
I thought about adding a
fail_on
bool parameter to the Message class to avoid passing the fail_on_symbol list to the reporter class, but I think that would have too many impacts on other areas/reporters, e.g. the json output.Closes #9898