From 4693b325e85c1d7e3529ab2a209405701da6f274 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Wed, 9 Nov 2022 12:22:17 -0500 Subject: BaseTools/PatchCheck.py: Add PCCTS to tab exemption list 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 Reviewed-by: Rebecca Cran Reviewed-by: Oliver Smith-Denny --- BaseTools/Scripts/PatchCheck.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index fcdabfc8ac..5d17d99a12 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -383,7 +383,10 @@ class GitDiffCheck: self.force_crlf = False self.force_notabs = False if os.path.basename(self.filename) == 'GNUmakefile' or \ - os.path.basename(self.filename) == 'Makefile': + os.path.basename(self.filename).lower() == 'makefile' or \ + os.path.splitext(self.filename)[1] == '.makefile' or \ + self.filename.startswith( + 'BaseTools/Source/C/VfrCompile/Pccts/'): self.force_notabs = False elif len(line.rstrip()) != 0: self.format_error("didn't find diff command") -- cgit