diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2022-11-09 12:22:17 -0500 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-04-03 15:29:08 +0000 |
commit | 4693b325e85c1d7e3529ab2a209405701da6f274 (patch) | |
tree | 881f867a6f42ec72a1f8098d49c104d1dc882c70 /BaseTools/Scripts | |
parent | 33f517445b218e11660a0024997201d954384c84 (diff) | |
download | edk2-4693b325e85c1d7e3529ab2a209405701da6f274.zip edk2-4693b325e85c1d7e3529ab2a209405701da6f274.tar.gz edk2-4693b325e85c1d7e3529ab2a209405701da6f274.tar.bz2 |
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 <rebecca@bsdio.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Diffstat (limited to 'BaseTools/Scripts')
-rwxr-xr-x | BaseTools/Scripts/PatchCheck.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index fcdabfc..5d17d99 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")
|