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>
This commit is contained in:
committed by
mergify[bot]
parent
778134e491
commit
ae02d487a3
@ -363,6 +363,9 @@ class GitDiffCheck:
|
|||||||
self.is_newfile = False
|
self.is_newfile = False
|
||||||
self.force_crlf = True
|
self.force_crlf = True
|
||||||
self.force_notabs = True
|
self.force_notabs = True
|
||||||
|
if self.filename.endswith('.rtf'):
|
||||||
|
self.force_crlf = False
|
||||||
|
self.force_notabs = False
|
||||||
if self.filename.endswith('.sh') or \
|
if self.filename.endswith('.sh') or \
|
||||||
self.filename.startswith('BaseTools/BinWrappers/PosixLike/') or \
|
self.filename.startswith('BaseTools/BinWrappers/PosixLike/') or \
|
||||||
self.filename.startswith('BaseTools/BinPipWrappers/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.format_error("didn't find diff hunk marker (@@)")
|
||||||
self.line_num += 1
|
self.line_num += 1
|
||||||
elif self.state == PATCH:
|
elif self.state == PATCH:
|
||||||
if self.binary:
|
if self.binary or self.filename.endswith(".rtf"):
|
||||||
pass
|
pass
|
||||||
elif line.startswith('-'):
|
elif line.startswith('-'):
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user