* [PATCH v2] tools/lib/python: kdoc: remove unused parameters from _fill_text() and _format_usage()
@ 2026-05-15 11:42 Yash Rai
2026-05-25 20:40 ` Jonathan Corbet
0 siblings, 1 reply; 3+ messages in thread
From: Yash Rai @ 2026-05-15 11:42 UTC (permalink / raw)
To: corbet, mchehab+huawei; +Cc: linux-kernel, Yash Rai
The parameters 'width' in _fill_text() and 'usage', 'groups' in
_format_usage() are not used within these methods. Use *args and
**kwargs to properly handle them while maintaining the override
contract with argparse.HelpFormatter.
This is a cleanup with no functional change.
Signed-off-by: Yash Rai <yash2154rai@gmail.com>
---
tools/lib/python/kdoc/enrich_formatter.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lib/python/kdoc/enrich_formatter.py b/tools/lib/python/kdoc/enrich_formatter.py
index 7e0f09f5ccea..bd2321fa11ea 100644
--- a/tools/lib/python/kdoc/enrich_formatter.py
+++ b/tools/lib/python/kdoc/enrich_formatter.py
@@ -42,14 +42,14 @@ class EnrichFormatter(argparse.HelpFormatter):
lambda m: f'\033[1m{m.group(1)}\033[0m', text)
return text
- def _fill_text(self, text, indent):
+ def _fill_text(self, text, indent, *args, **kwargs):
"""
Enrich descriptions with markups on it.
"""
enriched = self.enrich_text(text)
return "\n".join(indent + line for line in enriched.splitlines())
- def _format_usage(self, actions, prefix):
+ def _format_usage(self, actions, prefix, *args, **kwargs):
"""
Enrich positional arguments at usage: line.
"""
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] tools/lib/python: kdoc: remove unused parameters from _fill_text() and _format_usage()
2026-05-15 11:42 [PATCH v2] tools/lib/python: kdoc: remove unused parameters from _fill_text() and _format_usage() Yash Rai
@ 2026-05-25 20:40 ` Jonathan Corbet
2026-05-28 6:14 ` Yash Rai
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Corbet @ 2026-05-25 20:40 UTC (permalink / raw)
To: Yash Rai, mchehab+huawei; +Cc: linux-kernel, Yash Rai
Yash Rai <yash2154rai@gmail.com> writes:
> The parameters 'width' in _fill_text() and 'usage', 'groups' in
> _format_usage() are not used within these methods. Use *args and
> **kwargs to properly handle them while maintaining the override
> contract with argparse.HelpFormatter.
>
> This is a cleanup with no functional change.
>
> Signed-off-by: Yash Rai <yash2154rai@gmail.com>
> ---
> tools/lib/python/kdoc/enrich_formatter.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/lib/python/kdoc/enrich_formatter.py b/tools/lib/python/kdoc/enrich_formatter.py
> index 7e0f09f5ccea..bd2321fa11ea 100644
> --- a/tools/lib/python/kdoc/enrich_formatter.py
> +++ b/tools/lib/python/kdoc/enrich_formatter.py
> @@ -42,14 +42,14 @@ class EnrichFormatter(argparse.HelpFormatter):
> lambda m: f'\033[1m{m.group(1)}\033[0m', text)
> return text
>
> - def _fill_text(self, text, indent):
> + def _fill_text(self, text, indent, *args, **kwargs):
> """
> Enrich descriptions with markups on it.
> """
> enriched = self.enrich_text(text)
> return "\n".join(indent + line for line in enriched.splitlines())
>
> - def _format_usage(self, actions, prefix):
> + def _format_usage(self, actions, prefix, *args, **kwargs):
> """
This patch removes no parameters, and won't apply. You are, I'm
guessing, applying this on top of your previous patch? Don't do that;
send a completely new patch in response to review comments.
I have to say, though, that I don't really see the value in this change;
you're exchanging one set of unused parameters for a different, even
more mysterious set. Why do we want to do that?
Thanks,
jon
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] tools/lib/python: kdoc: remove unused parameters from _fill_text() and _format_usage()
2026-05-25 20:40 ` Jonathan Corbet
@ 2026-05-28 6:14 ` Yash Rai
0 siblings, 0 replies; 3+ messages in thread
From: Yash Rai @ 2026-05-28 6:14 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: mchehab+huawei, linux-kernel
On Mon, May 25, 2026 at 02:40:59PM -0600, Jonathan Corbet wrote:
> Yash Rai <yash2154rai@gmail.com> writes:
>
> > The parameters 'width' in _fill_text() and 'usage', 'groups' in
> > _format_usage() are not used within these methods. Use *args and
> > **kwargs to properly handle them while maintaining the override
> > contract with argparse.HelpFormatter.
> >
> > This is a cleanup with no functional change.
> >
> > Signed-off-by: Yash Rai <yash2154rai@gmail.com>
> > ---
> > tools/lib/python/kdoc/enrich_formatter.py | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/lib/python/kdoc/enrich_formatter.py b/tools/lib/python/kdoc/enrich_formatter.py
> > index 7e0f09f5ccea..bd2321fa11ea 100644
> > --- a/tools/lib/python/kdoc/enrich_formatter.py
> > +++ b/tools/lib/python/kdoc/enrich_formatter.py
> > @@ -42,14 +42,14 @@ class EnrichFormatter(argparse.HelpFormatter):
> > lambda m: f'\033[1m{m.group(1)}\033[0m', text)
> > return text
> >
> > - def _fill_text(self, text, indent):
> > + def _fill_text(self, text, indent, *args, **kwargs):
> > """
> > Enrich descriptions with markups on it.
> > """
> > enriched = self.enrich_text(text)
> > return "\n".join(indent + line for line in enriched.splitlines())
> >
> > - def _format_usage(self, actions, prefix):
> > + def _format_usage(self, actions, prefix, *args, **kwargs):
> > """
>
> This patch removes no parameters, and won't apply. You are, I'm
> guessing, applying this on top of your previous patch? Don't do that;
> send a completely new patch in response to review comments.
>
> I have to say, though, that I don't really see the value in this change;
> you're exchanging one set of unused parameters for a different, even
> more mysterious set. Why do we want to do that?
>
> Thanks,
>
> jon
sorry about that and thanks for the feedback
Reason for replacing unused parameters with *args and **kwargs is to
avoid python warnings
Thanks,
yash
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-28 6:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 11:42 [PATCH v2] tools/lib/python: kdoc: remove unused parameters from _fill_text() and _format_usage() Yash Rai
2026-05-25 20:40 ` Jonathan Corbet
2026-05-28 6:14 ` Yash Rai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.