summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorRebecca Cran <rebecca@bsdio.com>2023-11-01 17:55:52 -0600
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-11-06 20:25:57 +0000
commitae02d487a3a4f198e37ca5029ae04abd8976076d (patch)
tree2f3d4d5f5492817d73e58f9892c25c591147b052 /BaseTools
parent778134e491a9f53abc903f6fa730d8389f27697d (diff)
downloadedk2-ae02d487a3a4f198e37ca5029ae04abd8976076d.tar.gz
edk2-ae02d487a3a4f198e37ca5029ae04abd8976076d.tar.bz2
edk2-ae02d487a3a4f198e37ca5029ae04abd8976076d.zip
BaseTools: Update PatchCheck.py to allow whitespace issues in .rtf files
Allow .rtf files created by applications such as Notepad to be committed as-is without further manual editing by skipping the requirements for CRLF, no tabs and no trailing whitespace. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'BaseTools')
-rwxr-xr-xBaseTools/Scripts/PatchCheck.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 900226f18f..7f372d40b5 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -363,6 +363,9 @@ class GitDiffCheck:
self.is_newfile = False
self.force_crlf = True
self.force_notabs = True
+ if self.filename.endswith('.rtf'):
+ self.force_crlf = False
+ self.force_notabs = False
if self.filename.endswith('.sh') or \
self.filename.startswith('BaseTools/BinWrappers/PosixLike/') or \
self.filename.startswith('BaseTools/BinPipWrappers/PosixLike/') or \
@@ -416,7 +419,7 @@ class GitDiffCheck:
self.format_error("didn't find diff hunk marker (@@)")
self.line_num += 1
elif self.state == PATCH:
- if self.binary:
+ if self.binary or self.filename.endswith(".rtf"):
pass
elif line.startswith('-'):
pass