From patchwork Mon May 30 07:22:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 16106 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 59120BD161 for ; Mon, 30 May 2022 07:22:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8E3A065634; Mon, 30 May 2022 09:22:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1653895367; bh=uZ1Yx+K+q6YMTAAVXS5gc3FfnIEmrOy2rcTKN2K9ENI=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=hc4UWfePZfX9TXdrF0HXLo5aPbM+/ARneuLRbgcFrTy42/SFBmsi0JY92+8VWBZmb V/Zrlfln73MPICH9BQc0VbUfIfrEQTRVbyYS0GPhjN2P3hJAnBuGXYLI62Cs/yNaBR lQ12D7npYKPQzCjrbUW+h0A3kA6u/4lElBnMCIrYGo9nRcqcd9C1vwRvN5i9LD0vy8 Wi8Qh2AGN8bwOKJSvLBG0V6+vPn2B0v5Oz8wTQmOwi/zkHi1fUZgKwwcy5t8T1Olta P/gi7APRCuoa345XOHlX4g+drRC5NPSvYZi7dxC1VZMfRltdYm+9/Xj0Zx9k1J0l9g NKvmDvjj8Su1w== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 359EC61FB7 for ; Mon, 30 May 2022 09:22:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="XAsqcpAi"; dkim-atps=neutral Received: from deskari.lan (91-156-85-209.elisa-laajakaista.fi [91.156.85.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7ADF96DF; Mon, 30 May 2022 09:22:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1653895365; bh=uZ1Yx+K+q6YMTAAVXS5gc3FfnIEmrOy2rcTKN2K9ENI=; h=From:To:Cc:Subject:Date:From; b=XAsqcpAimjeMb3wyIerLtQfWwzRs4uF1bYQtazG795nb2Q6LOFTRMIJunizLYRuc+ DJJ1idDHhqFtk4gYoBduzgaSiWQrv1Df8dzpDu/gG9H4si812sEk08gehX+/Xlxwoi Kq0+t1tSjN+OmBthGRoNethkmlgUAdxKXw9/DdXw= To: libcamera-devel@lists.libcamera.org, Laurent Pinchart , Kieran Bingham Date: Mon, 30 May 2022 10:22:28 +0300 Message-Id: <20220530072228.15916-1-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] utils: checkstyle.py: Fix color bleed X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tomi Valkeinen via libcamera-devel From: Tomi Valkeinen Reply-To: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- utils/checkstyle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/checkstyle.py b/utils/checkstyle.py index 835f2a9f..fa0513f2 100755 --- a/utils/checkstyle.py +++ b/utils/checkstyle.py @@ -743,9 +743,9 @@ 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)