Skip to content

Commit ae02d48

Browse files
bexcranmergify[bot]
authored andcommitted
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>
1 parent 778134e commit ae02d48

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

BaseTools/Scripts/PatchCheck.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ def run(self):
363363
self.is_newfile = False
364364
self.force_crlf = True
365365
self.force_notabs = True
366+
if self.filename.endswith('.rtf'):
367+
self.force_crlf = False
368+
self.force_notabs = False
366369
if self.filename.endswith('.sh') or \
367370
self.filename.startswith('BaseTools/BinWrappers/PosixLike/') or \
368371
self.filename.startswith('BaseTools/BinPipWrappers/PosixLike/') or \
@@ -416,7 +419,7 @@ def run(self):
416419
self.format_error("didn't find diff hunk marker (@@)")
417420
self.line_num += 1
418421
elif self.state == PATCH:
419-
if self.binary:
422+
if self.binary or self.filename.endswith(".rtf"):
420423
pass
421424
elif line.startswith('-'):
422425
pass

0 commit comments

Comments
 (0)