Re: [PATCH] tools/lib/python: kdoc: remove unused parameters from _fill_text() and _format_usage()
From: Jonathan Corbet
Date: Thu May 14 2026 - 12:13:38 EST
Yash Rai <yash2154rai@xxxxxxxxx> writes:
> The parameter 'width' in _fill_text() and 'usage' and 'groups'
> in _format_usage() are not used in enrich_formatter.py.
>
> This is a cleanup with no functional change.
>
> Signed-off-by: Yash Rai <yash2154rai@xxxxxxxxx>
> ---
> 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 d1be4e5e1962..7e0f09f5ccea 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, width, indent):
> + def _fill_text(self, text, indent):
> """
> 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, usage, actions, groups, prefix):
> + def _format_usage(self, actions, prefix):
> """
> Enrich positional arguments at usage: line.
> """
Looking at this patch, my immediate response is that you didn't change
any callers. That is ... because there are no callers. So, rather
than tweak the argument lists, is there a reason to not just delete
these functions altogether?
Thanks,
jon