On Wed, Oct 8, 2025 at 7:58 PM Stefan Hajnoczi <[email protected]> wrote:
>
> On Wed, Oct 08, 2025 at 08:35:41AM +0200, Paolo Bonzini wrote:
> > Sort imports automatically, to keep the coding style more uniform.
> >
> > Signed-off-by: Paolo Bonzini <[email protected]>
> > ---
> >  python/tests/tracetool-isort.sh      | 4 ++++
> >  scripts/tracetool.py                 | 5 ++---
> >  scripts/tracetool/backend/dtrace.py  | 1 -
> >  scripts/tracetool/backend/ftrace.py  | 3 +--
> >  scripts/tracetool/backend/log.py     | 3 +--
> >  scripts/tracetool/backend/simple.py  | 1 -
> >  scripts/tracetool/backend/syslog.py  | 3 +--
> >  scripts/tracetool/backend/ust.py     | 1 -
> >  scripts/tracetool/format/d.py        | 2 +-
> >  scripts/tracetool/format/log_stap.py | 1 -
> >  scripts/tracetool/format/stap.py     | 1 -
> >  11 files changed, 10 insertions(+), 15 deletions(-)
> >  create mode 100755 python/tests/tracetool-isort.sh
> >
> > diff --git a/python/tests/tracetool-isort.sh 
> > b/python/tests/tracetool-isort.sh
> > new file mode 100755
> > index 00000000000..b23f3d48448
> > --- /dev/null
> > +++ b/python/tests/tracetool-isort.sh
> > @@ -0,0 +1,4 @@
> > +#!/bin/sh -e
> > +# SPDX-License-Identifier: GPL-2.0-or-later
> > +
> > +python3 -m isort --sp . -c ../scripts/tracetool/
>
> I wonder why python/tests/isort.sh doesn't already cover this with its
> `python3 -m isort -c scripts/` line?

Because that one is for python/scripts. Not sure why John placed
mkvenv.py and venv.py in python/scripts, but the potential for
confusion is real.

> Also, why the --settings-path (--sp) option that python/tests/isort.sh
> doesn't use?

I honestly copied it from python/tests/qapi-isort.sh. I think it's
because python/scripts/ is a subdirectory of where python/setup.cfg
lives, but scripts/ is not.

> It would be great to have just 1 script that runs isort on all Python
> code in QEMU.

Yes, there's lots of room for cleanup there.

Paolo


Reply via email to