public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for *.makefile
@ 2023-03-24 16:32 Rebecca Cran
  2023-03-24 18:46 ` Michael D Kinney
  0 siblings, 1 reply; 3+ messages in thread
From: Rebecca Cran @ 2023-03-24 16:32 UTC (permalink / raw)
  To: devel, Bob Feng, Liming Gao, Yuwei Chen, Michael D Kinney; +Cc: Rebecca Cran

When checking for Makefiles, in addition to Makefile and GNUmakefile,
also check for *.makefile: this allows {header,footer,app,lib}.makefile
in BaseTools/Source/C/Makefiles to be detected and avoid having
PatchCheck.py complain about tab characters.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 BaseTools/Scripts/PatchCheck.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index fcdabfc8acea..3910015d173e 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -383,7 +383,8 @@ class GitDiffCheck:
                     self.force_crlf = False
                     self.force_notabs = False
                 if os.path.basename(self.filename) == 'GNUmakefile' or \
-                   os.path.basename(self.filename) == 'Makefile':
+                   os.path.basename(self.filename) == 'Makefile' or \
+                   os.path.basename(self.filename).endswith("makefile"):
                     self.force_notabs = False
             elif len(line.rstrip()) != 0:
                 self.format_error("didn't find diff command")
-- 
2.34.1


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

* Re: [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for *.makefile
  2023-03-24 16:32 [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for *.makefile Rebecca Cran
@ 2023-03-24 18:46 ` Michael D Kinney
  2023-03-24 19:18   ` Rebecca Cran
  0 siblings, 1 reply; 3+ messages in thread
From: Michael D Kinney @ 2023-03-24 18:46 UTC (permalink / raw)
  To: Rebecca Cran, devel@edk2.groups.io, Feng, Bob C, Gao, Liming,
	Chen, Christine
  Cc: Kinney, Michael D



> -----Original Message-----
> From: Rebecca Cran <rebecca@bsdio.com>
> Sent: Friday, March 24, 2023 9:32 AM
> To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Chen, Christine
> <yuwei.chen@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Subject: [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for *.makefile
> 
> When checking for Makefiles, in addition to Makefile and GNUmakefile,
> also check for *.makefile: this allows {header,footer,app,lib}.makefile
> in BaseTools/Source/C/Makefiles to be detected and avoid having
> PatchCheck.py complain about tab characters.
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
>  BaseTools/Scripts/PatchCheck.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
> index fcdabfc8acea..3910015d173e 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -383,7 +383,8 @@ class GitDiffCheck:
>                      self.force_crlf = False
>                      self.force_notabs = False
>                  if os.path.basename(self.filename) == 'GNUmakefile' or \
> -                   os.path.basename(self.filename) == 'Makefile':
> +                   os.path.basename(self.filename) == 'Makefile' or \
> +                   os.path.basename(self.filename).endswith("makefile"):

Should is be ".makefile" or perhaps use os.path.splitext() instead?

>                      self.force_notabs = False
>              elif len(line.rstrip()) != 0:
>                  self.format_error("didn't find diff command")
> --
> 2.34.1


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

* Re: [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for *.makefile
  2023-03-24 18:46 ` Michael D Kinney
@ 2023-03-24 19:18   ` Rebecca Cran
  0 siblings, 0 replies; 3+ messages in thread
From: Rebecca Cran @ 2023-03-24 19:18 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io, Feng, Bob C, Gao, Liming,
	Chen, Christine

On 3/24/23 12:46 PM, Kinney, Michael D wrote:
> Should is be ".makefile" or perhaps use os.path.splitext() instead?

Good point. I've updated the code to use os.path.splitext() instead, and 
change the check for 'Makefile' to be case-insensitive since some are 
which are missing the upper-case 'M':


./BaseTools/Source/C/VfrCompile/Pccts/support/genmk/makefile
./BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/makefile
./BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
./BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile


I've sent out a v2 revision.


-- 
Rebecca Cran


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

end of thread, other threads:[~2023-03-24 19:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-24 16:32 [PATCH 1/1] BaseTools/Scripts/PatchCheck.py: Check for *.makefile Rebecca Cran
2023-03-24 18:46 ` Michael D Kinney
2023-03-24 19:18   ` Rebecca Cran

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