From nobody Mon Feb 9 10:48:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+51791+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+51791+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575562395; cv=none; d=zohomail.com; s=zohoarc; b=Zx9JXqfshNkw55dSsIM+giqj+D5K7G3u5T/n4ajyrlSj7AunDmWFxD1Jwv0tUxiUBWYhZ9S08yHAY15EptckZ+eFs5DocIs+Usmkl4AuWtlGk2y7oXWfg4ZC5UtL2q3PEMlIz8i5xIRdb+1kiaOc/0EAH6QDIfnF9CRU/gYv22U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575562395; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=rqZ7bswg5HPQTx41tWfTqbpON/hMALCu4SwrAXOuEy4=; b=BCj4wpLi4WLXtkFyN+n7q+Guyd+/BertTtQhAiL+c2omSt+EbQHj+Bq1npV2mpvWwFlBG+mOd3XHntjBWwHFt0x4hxRPJjnrX1VprfH04430QplckdJcowW+cYLkiuJPyCzZ7zLiizqwxZme6B/8LTX4+Fm6prPyD6K5zVVUyWY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+51791+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1575562395211804.3796660354488; Thu, 5 Dec 2019 08:13:15 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id aaaaYY1788612xaaaaaaaaaa; Thu, 05 Dec 2019 08:13:14 -0800 X-Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.11654.1575562380387106129 for ; Thu, 05 Dec 2019 08:13:00 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-321-UetMGdkdOaiEjzAlvj79xA-1; Thu, 05 Dec 2019 11:12:56 -0500 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 86D89DBE7; Thu, 5 Dec 2019 16:12:54 +0000 (UTC) X-Received: from x1w.redhat.com (ovpn-205-76.brq.redhat.com [10.40.205.76]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C4A110013D9; Thu, 5 Dec 2019 16:12:53 +0000 (UTC) From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= To: devel@edk2.groups.io Cc: Philippe Mathieu-Daude , Bob Feng , Liming Gao Subject: [edk2-devel] [PATCH 6/6] BaseTools/PatchCheck: Allow to print colored warnings Date: Thu, 5 Dec 2019 17:12:34 +0100 Message-Id: <20191205161234.25071-7-philmd@redhat.com> In-Reply-To: <20191205161234.25071-1-philmd@redhat.com> References: <20191205161234.25071-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: UetMGdkdOaiEjzAlvj79xA-1 X-Mimecast-Spam-Score: 0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,philmd@redhat.com X-Gm-Message-State: aaaaaaaaaaaaaaaaaaaaaaaax1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1575562394; bh=E3/3QMAlMoAf6ni0wupFd7OzQKsKbDkHY/NaWwvcIbA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=mOwO8LWYFoX41izKORpQ2fZKg0e3piL0n8RnjgOx6aC3T3bNh68NBx3c/NJzyZr/5Yc /f93aKuirxoiPlwdF1UTfm4DUD52gJlnB+BWjA/n+xjSZdpmnoi/ZQ1Rw3dV0B+SrYMRo CRC2JnSZUWBI2uf34DU0lEs9E7kvtVhDHE0= X-ZohoMail-DKIM: pass (identity @groups.io) If the user has the termcolor package installed, and he configured a 'color.checkpatch.error' color, use it to display colored warnings. Example to display warnings in red: $ git config color.checkpatch.error red Cc: Bob Feng Cc: Liming Gao Signed-off-by: Philippe Mathieu-Daude --- BaseTools/Scripts/PatchCheck.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck= .py index 5692f6eaf8bd..8e37311bd69a 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -32,6 +32,19 @@ def printw(line): """Print a warning to the console.""" print(line) =20 +if run_git('config', 'color.ui') !=3D 'false': + # If the user configure git color.checkpatch.error and the termcolor p= ackage + # is available, display warnings using the requested color. + warning_color =3D run_git('config', 'color.checkpatch.error') + if warning_color: + try: + from termcolor import colored, cprint + _ =3D colored("check we can parse the color", warning_color.st= rip()) + def printw(line): + cprint(line, color=3Dwarning_color.strip(), attrs=3D['bold= ']) + except: + pass + class Verbose: SILENT, QUIET, ONELINE, NORMAL =3D range(4) level =3D NORMAL --=20 2.21.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51791): https://edk2.groups.io/g/devel/message/51791 Mute This Topic: https://groups.io/mt/67004111/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-