[PATCH RFC 02/10] python/qapi: Add an ignore for Pylint 4.x

John Snow posted 10 patches 2 weeks, 2 days ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
[PATCH RFC 02/10] python/qapi: Add an ignore for Pylint 4.x
Posted by John Snow 2 weeks, 2 days ago
Pylint 4.x wants to use a different regex for _Stub for some reason;
just silence this.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 scripts/qapi/introspect.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
index 89ee5d5f176..7e28de2279a 100644
--- a/scripts/qapi/introspect.py
+++ b/scripts/qapi/introspect.py
@@ -59,7 +59,7 @@
 #
 # Sadly, mypy does not support recursive types; so the _Stub alias is used to
 # mark the imprecision in the type model where we'd otherwise use JSONValue.
-_Stub = Any
+_Stub = Any  # pylint: disable=invalid-name
 _Scalar = Union[str, bool, None]
 _NonScalar = Union[Dict[str, _Stub], List[_Stub]]
 _Value = Union[_Scalar, _NonScalar]
-- 
2.51.0
Re: [PATCH RFC 02/10] python/qapi: Add an ignore for Pylint 4.x
Posted by Thomas Huth 2 weeks, 1 day ago
On 28/10/2025 23.03, John Snow wrote:
> Pylint 4.x wants to use a different regex for _Stub for some reason;
> just silence this.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>   scripts/qapi/introspect.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
> index 89ee5d5f176..7e28de2279a 100644
> --- a/scripts/qapi/introspect.py
> +++ b/scripts/qapi/introspect.py
> @@ -59,7 +59,7 @@
>   #
>   # Sadly, mypy does not support recursive types; so the _Stub alias is used to
>   # mark the imprecision in the type model where we'd otherwise use JSONValue.
> -_Stub = Any
> +_Stub = Any  # pylint: disable=invalid-name
>   _Scalar = Union[str, bool, None]
>   _NonScalar = Union[Dict[str, _Stub], List[_Stub]]
>   _Value = Union[_Scalar, _NonScalar]

Alternatively, rename it to "_stub" ?

Anyway,
Reviewed-by: Thomas Huth <thuth@redhat.com>
Re: [PATCH RFC 02/10] python/qapi: Add an ignore for Pylint 4.x
Posted by John Snow 2 weeks, 1 day ago
On Thu, Oct 30, 2025, 4:23 AM Thomas Huth <thuth@redhat.com> wrote:

> On 28/10/2025 23.03, John Snow wrote:
> > Pylint 4.x wants to use a different regex for _Stub for some reason;
> > just silence this.
> >
> > Signed-off-by: John Snow <jsnow@redhat.com>
> > ---
> >   scripts/qapi/introspect.py | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
> > index 89ee5d5f176..7e28de2279a 100644
> > --- a/scripts/qapi/introspect.py
> > +++ b/scripts/qapi/introspect.py
> > @@ -59,7 +59,7 @@
> >   #
> >   # Sadly, mypy does not support recursive types; so the _Stub alias is
> used to
> >   # mark the imprecision in the type model where we'd otherwise use
> JSONValue.
> > -_Stub = Any
> > +_Stub = Any  # pylint: disable=invalid-name
> >   _Scalar = Union[str, bool, None]
> >   _NonScalar = Union[Dict[str, _Stub], List[_Stub]]
> >   _Value = Union[_Scalar, _NonScalar]
>
> Alternatively, rename it to "_stub" ?
>

Well, it's a "type" and it should match the others, ... I don't actually
know why it is deciding to whine about this and had bigger fish to fry.


> Anyway,
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
>