summaryrefslogtreecommitdiff
path: root/utils/checkstyle.py
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-05-30 10:22:28 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-06-03 23:35:22 +0300
commitb4bb5ce629294e5a0b186c6824ffe231bd86c3c7 (patch)
tree0c2335150149ee7f8dfe13802ddbdb551f03bf62 /utils/checkstyle.py
parent30d55d584a5f67d99e6f4c4cc3350e16c5aad6ef (diff)
utils: checkstyle.py: Fix color bleed
If issue.line is None, the the terminal color is never reset back to normal. This causes the yellow color to bleed. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'utils/checkstyle.py')
-rwxr-xr-xutils/checkstyle.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 61783165..f0248d65 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -760,9 +760,11 @@ def check_file(top_level, commit, filename):
if len(issues):
issues = sorted(issues, key=lambda i: i.line_number)
for issue in issues:
- print('%s#%u: %s' % (Colours.fg(Colours.Yellow), issue.line_number, issue.msg))
+ print('%s#%u: %s%s' % (Colours.fg(Colours.Yellow), issue.line_number,
+ issue.msg, Colours.reset()))
if issue.line is not None:
- print('+%s%s' % (issue.line.rstrip(), Colours.reset()))
+ print('%s+%s%s' % (Colours.fg(Colours.Yellow), issue.line.rstrip(),
+ Colours.reset()))
return len(formatted_diff) + len(issues)