Skip to content

Commit

Permalink
BaseTools: Update PatchCheck.py to allow whitespace issues in .rtf files
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Acked-by: Laszlo Ersek <[email protected]>
  • Loading branch information
bexcran authored and mergify[bot] committed Nov 6, 2023
1 parent 778134e commit ae02d48
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion BaseTools/Scripts/PatchCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ def run(self):
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 \
Expand Down Expand Up @@ -416,7 +419,7 @@ def run(self):
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
Expand Down

0 comments on commit ae02d48

Please sign in to comment.