* [PATCH v2 1/1] BaseTools/Scripts/PatchCheck.py: Improve check for Makefiles
@ 2023-03-24 19:16 Rebecca Cran
2023-03-24 19:34 ` Michael D Kinney
0 siblings, 1 reply; 2+ messages in thread
From: Rebecca Cran @ 2023-03-24 19:16 UTC (permalink / raw)
To: devel, Bob Feng, Liming Gao, Yuwei Chen, Michael D Kinney; +Cc: Rebecca Cran
When checking for Makefiles, 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.
Also, change the check for "Makefile" to be case-insensitive since there
are some Makefiles named 'makefile' instead of 'Makefile'.
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..241467f10ea5 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).lower() == 'makefile' or \
+ os.path.splitext(self.filename)[1] == ".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] 2+ messages in thread
* Re: [PATCH v2 1/1] BaseTools/Scripts/PatchCheck.py: Improve check for Makefiles
2023-03-24 19:16 [PATCH v2 1/1] BaseTools/Scripts/PatchCheck.py: Improve check for Makefiles Rebecca Cran
@ 2023-03-24 19:34 ` Michael D Kinney
0 siblings, 0 replies; 2+ messages in thread
From: Michael D Kinney @ 2023-03-24 19:34 UTC (permalink / raw)
To: Rebecca Cran, devel@edk2.groups.io, Feng, Bob C, Gao, Liming,
Chen, Christine
Cc: Kinney, Michael D
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> -----Original Message-----
> From: Rebecca Cran <rebecca@bsdio.com>
> Sent: Friday, March 24, 2023 12:17 PM
> 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 v2 1/1] BaseTools/Scripts/PatchCheck.py: Improve check for Makefiles
>
> When checking for Makefiles, 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.
>
> Also, change the check for "Makefile" to be case-insensitive since there
> are some Makefiles named 'makefile' instead of 'Makefile'.
>
> 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..241467f10ea5 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).lower() == 'makefile' or \
> + os.path.splitext(self.filename)[1] == ".makefile":
> 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] 2+ messages in thread
end of thread, other threads:[~2023-03-24 19:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-24 19:16 [PATCH v2 1/1] BaseTools/Scripts/PatchCheck.py: Improve check for Makefiles Rebecca Cran
2023-03-24 19:34 ` Michael D Kinney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox