From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.10566.1679697062050366163 for ; Fri, 24 Mar 2023 15:31:02 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=FA/m//8a; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [47.201.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id B1C0920FC4D5; Fri, 24 Mar 2023 15:30:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B1C0920FC4D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1679697059; bh=+Kn+MiLApAwJNs/4PyrL6rQstDJdg+5z/doPQDoSWkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FA/m//8atdQCxyiS3hu1ND/MSROD/b/j2mE393WHIXdc6ec7QrlKEuZ3H39e/l+k+ EvxxOoxg5YIyHFjlzHGYviYIUDYlPGoq/O5LP0ZMHhkRn2GpU//weQYJVDxakDIFNc g02wmr3ODYl+uNDJFDfLpWXx1E1K3mTCEOkGiMWQ= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Rebecca Cran , Bob Feng , Liming Gao , Michael D Kinney , Sean Brogan , Yuwei Chen Subject: [PATCH v7 02/12] BaseTools/PatchCheck.py: Add PCCTS to tab exemption list Date: Fri, 24 Mar 2023 18:30:24 -0400 Message-Id: <20230324223034.1560-3-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.40.0.windows.1 In-Reply-To: <20230324223034.1560-1-mikuback@linux.microsoft.com> References: <20230324223034.1560-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki Purdue Compiler Construction Tool Set (PCCTS) source code was copied/ pasted into BaseTools/Source/C/VfrCompile/Pccts/. The code contains tab characters instead of spaces. PatchCheck.py gives an error on modifications to files that contain tabs. The goal of my upcoming change there is not to mix tabs and spaces but to fix a bug while preserving its current formatting characters. This change adds that directory to the pre-existing list of directories in which tab checks are ignored in PatchCheck.py and also updates the check for makefiles to check for *.makefile: this allows {header,footer,app,lib}.makefile in BaseTools/Source/C/Makefiles to be detected and avoid having PatchCheck.py complain about tab characters. The check for "Makefile" is updated to be case-insensitive since there are some Makefiles named 'makefile' instead of 'Makefile'. Co-authored-by: Rebecca Cran Cc: Bob Feng Cc: Liming Gao Cc: Michael D Kinney Cc: Sean Brogan Cc: Yuwei Chen Signed-off-by: Michael Kubacki Reviewed-by: Liming Gao Reviewed-by: Michael D Kinney --- BaseTools/Scripts/PatchCheck.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchChe= ck.py index fcdabfc8acea..5d17d99a12ef 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -383,7 +383,10 @@ class GitDiffCheck: self.force_crlf =3D False self.force_notabs =3D False if os.path.basename(self.filename) =3D=3D 'GNUmakefile' = or \ - os.path.basename(self.filename) =3D=3D 'Makefile': + os.path.basename(self.filename).lower() =3D=3D 'makef= ile' or \ + os.path.splitext(self.filename)[1] =3D=3D '.makefile'= or \ + self.filename.startswith( + 'BaseTools/Source/C/VfrCompile/Pccts/'): self.force_notabs =3D False elif len(line.rstrip()) !=3D 0: self.format_error("didn't find diff command") --=20 2.40.0.windows.1