scripts/qapi: minor delinting
authorJohn Snow <jsnow@redhat.com>
Fri, 11 Feb 2022 18:36:50 +0000 (13:36 -0500)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 28 Feb 2022 10:39:35 +0000 (11:39 +0100)
Get isort and pylint tools passing again.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20220211183650.2946895-1-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Comment explaining good-names-rgxs tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/commands.py
scripts/qapi/pylintrc
scripts/qapi/types.py
scripts/qapi/visit.py

index 869d799ed228261dfe7f186d05a3e0b93e6ca3e4..38ca38a7b9dde929446e14e1c6040e9f6f30832f 100644 (file)
@@ -25,8 +25,8 @@ from .gen import (
     QAPIGenC,
     QAPISchemaModularCVisitor,
     build_params,
-    ifcontext,
     gen_special_features,
+    ifcontext,
 )
 from .schema import (
     QAPISchema,
index b259531a726719d0823088eae757f4ddf8e683ef..a72462820308c0b72c5c070937332e9137514a2c 100644 (file)
@@ -34,16 +34,12 @@ disable=fixme,
 
 [BASIC]
 
-# Good variable names which should always be accepted, separated by a comma.
-good-names=i,
-           j,
-           k,
-           ex,
-           Run,
-           _,
-           fp,  # fp = open(...)
-           fd,  # fd = os.open(...)
-           ch,
+# Good variable names regexes, separated by a comma. If names match any regex,
+# they will always be accepted.
+#
+# Suppress complaints about short names.  PEP-8 is cool with them,
+# and so are we.
+good-names-rgxs=^[_a-z][_a-z0-9]?$
 
 [VARIABLES]
 
index 3013329c2482fd7e874f4dec8db681f8782e4511..477d02700137c2abdb1cc9dab411a0a43b7bab06 100644 (file)
@@ -16,7 +16,11 @@ This work is licensed under the terms of the GNU GPL, version 2.
 from typing import List, Optional
 
 from .common import c_enum_const, c_name, mcgen
-from .gen import QAPISchemaModularCVisitor, gen_special_features, ifcontext
+from .gen import (
+    QAPISchemaModularCVisitor,
+    gen_special_features,
+    ifcontext,
+)
 from .schema import (
     QAPISchema,
     QAPISchemaEnumMember,
index e13bbe42925fc6f43465170529b4e545675ca859..380fa197f589d6130e22a96cadc996aee560fdeb 100644 (file)
@@ -21,7 +21,11 @@ from .common import (
     indent,
     mcgen,
 )
-from .gen import QAPISchemaModularCVisitor, gen_special_features, ifcontext
+from .gen import (
+    QAPISchemaModularCVisitor,
+    gen_special_features,
+    ifcontext,
+)
 from .schema import (
     QAPISchema,
     QAPISchemaEnumMember,