Re: [PATCH] scripts/show_delta: reformat code

From: Nicolas Schier
Date: Fri Dec 01 2023 - 07:10:42 EST


On Fri, Dec 01, 2023 at 12:56:14PM +0800, Hu Haowen wrote:
>
> On 2023/12/1 01:13, Miguel Ojeda wrote:
> > On Thu, Nov 30, 2023 at 3:49 PM Hu Haowen <2023002089@xxxxxxxxxxxxxxxx> wrote:
> > > - if string.find(rest, base_str)==1:
> > > + if string.find(rest, base_str) == 1:
> > If this is changed, shouldn't be others like:
> >
> > > if arg=="-b":
> > > elif arg=="-h":
> > be changed too?
>
>
> Sorry, ignored by accident. I'll make up within the next patch version.
>
>
> > In other words, it seems this was done manually. Should we instead
> > introduce/use something like Black or Ruff if we are going to do this
> > sort of changes?
>
>
> I'm sorry but I'm not familiar with these two things. Are Black and Ruff
> some kind of tools which help identify these code format issues? If so
> it is better to introduce them to assist to accomplish the similar
> series of work instead of only completing it manually with avoiding
> omitted parts simultaneously.

yes, both are Python code formatters:

Black:
Documentation: https://black.readthedocs.io/en/stable/
Repology: https://repology.org/project/black/

Ruff:
Documentation: https://docs.astral.sh/ruff/formatter/
Repology: https://repology.org/project/ruff-python-linter/

Kind regards,
Nicolas