public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 0/1] SpellCheck plugin inspects fewer files when run on Linux
@ 2021-06-12  5:04 Kun Qin
  2021-06-12  5:04 ` [PATCH v1 1/1] Pytool: SpellCheck: Defer path expansion in cspell parameters Kun Qin
  0 siblings, 1 reply; 5+ messages in thread
From: Kun Qin @ 2021-06-12  5:04 UTC (permalink / raw)
  To: devel; +Cc: Sean Brogan, Bret Barkelew, Michael D Kinney, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3454

When spellcheck plugin invokes cspell to check files, it uses wildcard
path patterns, i.e. <package>/**/*.h.

On Linux system, this will be expanded by the shell therefore fewer files
will be picked up than speficied through original command line.

To resolve this issue, the path needs double quoting. So that the shell
does not expand and the input parameter is passed to cspell to expand.

Patch v1 branch: https://github.com/kuqin12/edk2/tree/exp_shell_v1

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>

Sean Brogan (1):
  Pytool: SpellCheck: Defer path expansion in cspell parameters

 .pytool/Plugin/SpellCheck/SpellCheck.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.31.1.windows.1


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

* [PATCH v1 1/1] Pytool: SpellCheck: Defer path expansion in cspell parameters
  2021-06-12  5:04 [PATCH v1 0/1] SpellCheck plugin inspects fewer files when run on Linux Kun Qin
@ 2021-06-12  5:04 ` Kun Qin
  2021-06-15 15:59   ` [edk2-devel] " Sean
  0 siblings, 1 reply; 5+ messages in thread
From: Kun Qin @ 2021-06-12  5:04 UTC (permalink / raw)
  To: devel; +Cc: Sean Brogan, Bret Barkelew, Michael D Kinney, Liming Gao

From: Sean Brogan <sean.brogan@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3454

On Linux the shell expands the wildcard paths and causes multiple files
to be missed. This change adds additional quotes to defer expansion in
order to bring parity in cspell result.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>

Signed-off-by: Sean Brogan <sean.brogan@microsoft.com>
---
 .pytool/Plugin/SpellCheck/SpellCheck.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.pytool/Plugin/SpellCheck/SpellCheck.py b/.pytool/Plugin/SpellCheck/SpellCheck.py
index 43365441b91c..97b240ef747c 100644
--- a/.pytool/Plugin/SpellCheck/SpellCheck.py
+++ b/.pytool/Plugin/SpellCheck/SpellCheck.py
@@ -133,7 +133,8 @@ class SpellCheck(ICiBuildPlugin):
         #
         relpath = os.path.relpath(abs_pkg_path)
         cpsell_paths = " ".join(
-            [f"{relpath}/**/{x}" for x in package_relative_paths_to_spell_check])
+            # Double quote each path to defer expansion to cspell parameters
+            [f'"{relpath}/**/{x}"' for x in package_relative_paths_to_spell_check])
 
         # Make the config file
         config_file_path = os.path.join(
-- 
2.31.1.windows.1


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

* Re: [edk2-devel] [PATCH v1 1/1] Pytool: SpellCheck: Defer path expansion in cspell parameters
  2021-06-12  5:04 ` [PATCH v1 1/1] Pytool: SpellCheck: Defer path expansion in cspell parameters Kun Qin
@ 2021-06-15 15:59   ` Sean
  2021-06-15 16:20     ` [EXTERNAL] " Bret Barkelew
  0 siblings, 1 reply; 5+ messages in thread
From: Sean @ 2021-06-15 15:59 UTC (permalink / raw)
  To: devel, kuqin12; +Cc: Sean Brogan, Bret Barkelew, Michael D Kinney, Liming Gao

Please update the signed-off-by to include yours.

Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>

Thanks
Sean


On 6/11/2021 10:04 PM, Kun Qin wrote:
> From: Sean Brogan <sean.brogan@microsoft.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3454
> 
> On Linux the shell expands the wildcard paths and causes multiple files
> to be missed. This change adds additional quotes to defer expansion in
> order to bring parity in cspell result.
> 
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> 
> Signed-off-by: Sean Brogan <sean.brogan@microsoft.com>
> ---
>   .pytool/Plugin/SpellCheck/SpellCheck.py | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/.pytool/Plugin/SpellCheck/SpellCheck.py b/.pytool/Plugin/SpellCheck/SpellCheck.py
> index 43365441b91c..97b240ef747c 100644
> --- a/.pytool/Plugin/SpellCheck/SpellCheck.py
> +++ b/.pytool/Plugin/SpellCheck/SpellCheck.py
> @@ -133,7 +133,8 @@ class SpellCheck(ICiBuildPlugin):
>           #
>           relpath = os.path.relpath(abs_pkg_path)
>           cpsell_paths = " ".join(
> -            [f"{relpath}/**/{x}" for x in package_relative_paths_to_spell_check])
> +            # Double quote each path to defer expansion to cspell parameters
> +            [f'"{relpath}/**/{x}"' for x in package_relative_paths_to_spell_check])
>   
>           # Make the config file
>           config_file_path = os.path.join(
> 

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

* Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 1/1] Pytool: SpellCheck: Defer path expansion in cspell parameters
  2021-06-15 15:59   ` [edk2-devel] " Sean
@ 2021-06-15 16:20     ` Bret Barkelew
  2021-06-15 17:04       ` Kun Qin
  0 siblings, 1 reply; 5+ messages in thread
From: Bret Barkelew @ 2021-06-15 16:20 UTC (permalink / raw)
  To: Sean Brogan, devel@edk2.groups.io, kuqin12@gmail.com
  Cc: Sean Brogan, Kinney, Michael D, Liming Gao

[-- Attachment #1: Type: text/plain, Size: 2553 bytes --]

Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>

- Bret

From: Sean Brogan<mailto:spbrogan@outlook.com>
Sent: Tuesday, June 15, 2021 9:00 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; kuqin12@gmail.com<mailto:kuqin12@gmail.com>
Cc: Sean Brogan<mailto:sean.brogan@microsoft.com>; Bret Barkelew<mailto:Bret.Barkelew@microsoft.com>; Kinney, Michael D<mailto:michael.d.kinney@intel.com>; Liming Gao<mailto:gaoliming@byosoft.com.cn>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v1 1/1] Pytool: SpellCheck: Defer path expansion in cspell parameters

Please update the signed-off-by to include yours.

Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>

Thanks
Sean


On 6/11/2021 10:04 PM, Kun Qin wrote:
> From: Sean Brogan <sean.brogan@microsoft.com>
>
> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3454&amp;data=04%7C01%7CBret.Barkelew%40microsoft.com%7C436f445e3f774d2549b608d930169d05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637593696216659744%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=pJiLG4bZ8gYR0MjDuNTmuT3NgRjq%2FZRMnTi1sT67VqM%3D&amp;reserved=0
>
> On Linux the shell expands the wildcard paths and causes multiple files
> to be missed. This change adds additional quotes to defer expansion in
> order to bring parity in cspell result.
>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
>
> Signed-off-by: Sean Brogan <sean.brogan@microsoft.com>
> ---
>   .pytool/Plugin/SpellCheck/SpellCheck.py | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/.pytool/Plugin/SpellCheck/SpellCheck.py b/.pytool/Plugin/SpellCheck/SpellCheck.py
> index 43365441b91c..97b240ef747c 100644
> --- a/.pytool/Plugin/SpellCheck/SpellCheck.py
> +++ b/.pytool/Plugin/SpellCheck/SpellCheck.py
> @@ -133,7 +133,8 @@ class SpellCheck(ICiBuildPlugin):
>           #
>           relpath = os.path.relpath(abs_pkg_path)
>           cpsell_paths = " ".join(
> -            [f"{relpath}/**/{x}" for x in package_relative_paths_to_spell_check])
> +            # Double quote each path to defer expansion to cspell parameters
> +            [f'"{relpath}/**/{x}"' for x in package_relative_paths_to_spell_check])
>
>           # Make the config file
>           config_file_path = os.path.join(
>


[-- Attachment #2: Type: text/html, Size: 5653 bytes --]

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

* Re: [EXTERNAL] Re: [edk2-devel] [PATCH v1 1/1] Pytool: SpellCheck: Defer path expansion in cspell parameters
  2021-06-15 16:20     ` [EXTERNAL] " Bret Barkelew
@ 2021-06-15 17:04       ` Kun Qin
  0 siblings, 0 replies; 5+ messages in thread
From: Kun Qin @ 2021-06-15 17:04 UTC (permalink / raw)
  To: Bret Barkelew, Sean Brogan, devel@edk2.groups.io
  Cc: Sean Brogan, Kinney, Michael D, Liming Gao

Thanks for the review. Updated patch has been sent here: 
https://edk2.groups.io/g/devel/message/76553.

Please let me know if any other feedbacks.

Regards,
Kun

On 06/15/2021 09:20, Bret Barkelew wrote:
> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
> 
> - Bret
> 
> *From: *Sean Brogan <mailto:spbrogan@outlook.com>
> *Sent: *Tuesday, June 15, 2021 9:00 AM
> *To: *devel@edk2.groups.io <mailto:devel@edk2.groups.io>; 
> kuqin12@gmail.com <mailto:kuqin12@gmail.com>
> *Cc: *Sean Brogan <mailto:sean.brogan@microsoft.com>; Bret Barkelew 
> <mailto:Bret.Barkelew@microsoft.com>; Kinney, Michael D 
> <mailto:michael.d.kinney@intel.com>; Liming Gao 
> <mailto:gaoliming@byosoft.com.cn>
> *Subject: *[EXTERNAL] Re: [edk2-devel] [PATCH v1 1/1] Pytool: 
> SpellCheck: Defer path expansion in cspell parameters
> 
> Please update the signed-off-by to include yours.
> 
> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
> 
> Thanks
> Sean
> 
> 
> On 6/11/2021 10:04 PM, Kun Qin wrote:
>  > From: Sean Brogan <sean.brogan@microsoft.com>
>  >
>  > REF: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3454&amp;data=04%7C01%7CBret.Barkelew%40microsoft.com%7C436f445e3f774d2549b608d930169d05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637593696216659744%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=pJiLG4bZ8gYR0MjDuNTmuT3NgRjq%2FZRMnTi1sT67VqM%3D&amp;reserved=0 
> <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3454&amp;data=04%7C01%7CBret.Barkelew%40microsoft.com%7C436f445e3f774d2549b608d930169d05%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637593696216659744%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=pJiLG4bZ8gYR0MjDuNTmuT3NgRjq%2FZRMnTi1sT67VqM%3D&amp;reserved=0>
>  >
>  > On Linux the shell expands the wildcard paths and causes multiple files
>  > to be missed. This change adds additional quotes to defer expansion in
>  > order to bring parity in cspell result.
>  >
>  > Cc: Sean Brogan <sean.brogan@microsoft.com>
>  > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
>  > Cc: Michael D Kinney <michael.d.kinney@intel.com>
>  > Cc: Liming Gao <gaoliming@byosoft.com.cn>
>  >
>  > Signed-off-by: Sean Brogan <sean.brogan@microsoft.com>
>  > ---
>  >   .pytool/Plugin/SpellCheck/SpellCheck.py | 3 ++-
>  >   1 file changed, 2 insertions(+), 1 deletion(-)
>  >
>  > diff --git a/.pytool/Plugin/SpellCheck/SpellCheck.py 
> b/.pytool/Plugin/SpellCheck/SpellCheck.py
>  > index 43365441b91c..97b240ef747c 100644
>  > --- a/.pytool/Plugin/SpellCheck/SpellCheck.py
>  > +++ b/.pytool/Plugin/SpellCheck/SpellCheck.py
>  > @@ -133,7 +133,8 @@ class SpellCheck(ICiBuildPlugin):
>  >           #
>  >           relpath = os.path.relpath(abs_pkg_path)
>  >           cpsell_paths = " ".join(
>  > -            [f"{relpath}/**/{x}" for x in 
> package_relative_paths_to_spell_check])
>  > +            # Double quote each path to defer expansion to cspell 
> parameters
>  > +            [f'"{relpath}/**/{x}"' for x in 
> package_relative_paths_to_spell_check])
>  >
>  >           # Make the config file
>  >           config_file_path = os.path.join(
>  >
> 

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

end of thread, other threads:[~2021-06-15 17:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-12  5:04 [PATCH v1 0/1] SpellCheck plugin inspects fewer files when run on Linux Kun Qin
2021-06-12  5:04 ` [PATCH v1 1/1] Pytool: SpellCheck: Defer path expansion in cspell parameters Kun Qin
2021-06-15 15:59   ` [edk2-devel] " Sean
2021-06-15 16:20     ` [EXTERNAL] " Bret Barkelew
2021-06-15 17:04       ` Kun Qin

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