public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH 1/1] BaseTools: Update PatchCheck.py to allow whitespace issues in .rtf files
@ 2023-11-02  0:20 Rebecca Cran
  2023-11-02 10:56 ` Laszlo Ersek
  2023-11-03 14:41 ` Rebecca Cran
  0 siblings, 2 replies; 4+ messages in thread
From: Rebecca Cran @ 2023-11-02  0:20 UTC (permalink / raw)
  To: devel, Liming Gao, Bob Feng, Yuwei Chen; +Cc: Rebecca Cran

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>
---
 BaseTools/Scripts/PatchCheck.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 900226f18fe5..7f372d40b570 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
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110495): https://edk2.groups.io/g/devel/message/110495
Mute This Topic: https://groups.io/mt/102332684/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] BaseTools: Update PatchCheck.py to allow whitespace issues in .rtf files
  2023-11-02  0:20 [edk2-devel] [PATCH 1/1] BaseTools: Update PatchCheck.py to allow whitespace issues in .rtf files Rebecca Cran
@ 2023-11-02 10:56 ` Laszlo Ersek
  2023-11-03 14:41 ` Rebecca Cran
  1 sibling, 0 replies; 4+ messages in thread
From: Laszlo Ersek @ 2023-11-02 10:56 UTC (permalink / raw)
  To: devel, rebecca, Liming Gao, Bob Feng, Yuwei Chen

On 11/2/23 01:20, Rebecca Cran wrote:
> 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>
> ---
>  BaseTools/Scripts/PatchCheck.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
> index 900226f18fe5..7f372d40b570 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

superficially
Acked-by: Laszlo Ersek <lersek@redhat.com>




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110521): https://edk2.groups.io/g/devel/message/110521
Mute This Topic: https://groups.io/mt/102332684/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] BaseTools: Update PatchCheck.py to allow whitespace issues in .rtf files
  2023-11-02  0:20 [edk2-devel] [PATCH 1/1] BaseTools: Update PatchCheck.py to allow whitespace issues in .rtf files Rebecca Cran
  2023-11-02 10:56 ` Laszlo Ersek
@ 2023-11-03 14:41 ` Rebecca Cran
  2023-11-06  1:04   ` 回复: " gaoliming via groups.io
  1 sibling, 1 reply; 4+ messages in thread
From: Rebecca Cran @ 2023-11-03 14:41 UTC (permalink / raw)
  To: Liming Gao; +Cc: devel, Bob Feng, Yuwei Chen

Liming, could you review this please? It's blocking another patch from 
being committed.

-- 
Rebecca

On 11/1/2023 6:20 PM, Rebecca Cran wrote:
> 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>
> ---
>   BaseTools/Scripts/PatchCheck.py | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
> index 900226f18fe5..7f372d40b570 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




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110629): https://edk2.groups.io/g/devel/message/110629
Mute This Topic: https://groups.io/mt/102332684/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

* 回复: [edk2-devel] [PATCH 1/1] BaseTools: Update PatchCheck.py to allow whitespace issues in .rtf files
  2023-11-03 14:41 ` Rebecca Cran
@ 2023-11-06  1:04   ` gaoliming via groups.io
  0 siblings, 0 replies; 4+ messages in thread
From: gaoliming via groups.io @ 2023-11-06  1:04 UTC (permalink / raw)
  To: devel, rebecca; +Cc: 'Bob Feng', 'Yuwei Chen'

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Rebecca Cran
> 发送时间: 2023年11月3日 22:42
> 收件人: Liming Gao <gaoliming@byosoft.com.cn>
> 抄送: devel@edk2.groups.io; Bob Feng <bob.c.feng@intel.com>; Yuwei Chen
> <yuwei.chen@intel.com>
> 主题: Re: [edk2-devel] [PATCH 1/1] BaseTools: Update PatchCheck.py to
> allow whitespace issues in .rtf files
> 
> Liming, could you review this please? It's blocking another patch from
> being committed.
> 
> --
> Rebecca
> 
> On 11/1/2023 6:20 PM, Rebecca Cran wrote:
> > 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>
> > ---
> >   BaseTools/Scripts/PatchCheck.py | 5 ++++-
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/BaseTools/Scripts/PatchCheck.py
> b/BaseTools/Scripts/PatchCheck.py
> > index 900226f18fe5..7f372d40b570 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
> 
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110691): https://edk2.groups.io/g/devel/message/110691
Mute This Topic: https://groups.io/mt/102412114/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-06  1:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-02  0:20 [edk2-devel] [PATCH 1/1] BaseTools: Update PatchCheck.py to allow whitespace issues in .rtf files Rebecca Cran
2023-11-02 10:56 ` Laszlo Ersek
2023-11-03 14:41 ` Rebecca Cran
2023-11-06  1:04   ` 回复: " gaoliming via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox