scripts/qapi: minor delinting
PATCH v2 1/1 scripts/qapi: minor delinting
Get isort and pylint tools passing again.
Signed-off-by John Snow <[email protected]>
--- scripts/qapi/commands.py | 2 +- scripts/qapi/pylintrc | 15 +++++---------- scripts/qapi/types.py | 6 +++++- scripts/qapi/visit.py | 6 +++++- 4 files changed, 16 insertions(+), 13 deletions(-)
scripts/qapi/commands.py +1 -1
@@ -25,8 +25,8 @@ QAPIGenC, QAPISchemaModularCVisitor, build_params, - ifcontext, gen_special_features, + ifcontext, ) from .schema import ( QAPISchema,
scripts/qapi/pylintrc +5 -10
@@ -34,16 +34,11 @@ 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 + +# Allow just about anything, as per Markus's preference. +good-names-rgxs=^[_a-z][_a-z0-9]?$ [VARIABLES]
scripts/qapi/types.py +5 -1
@@ -16,7 +16,11 @@ 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,
scripts/qapi/visit.py +5 -1
@@ -21,7 +21,11 @@ indent, mcgen, ) -from .gen import QAPISchemaModularCVisitor, gen_special_features, ifcontext +from .gen import ( + QAPISchemaModularCVisitor, + gen_special_features, + ifcontext, +) from .schema import ( QAPISchema, QAPISchemaEnumMember,
Signature · 1 line
2.34.1
Quoted 36 lines · John Snow
Get isort and pylint tools passing again.
Signed-off-by John Snow <[email protected]>--- scripts/qapi/commands.py | 2 +- scripts/qapi/pylintrc | 15 +++++---------- scripts/qapi/types.py | 6 +++++- scripts/qapi/visit.py | 6 +++++- 4 files changed, 16 insertions(+), 13 deletions(-)scripts/qapi/commands.py +1
-1@@ -25,8 +25,8 @@ QAPIGenC, QAPISchemaModularCVisitor, build_params, - ifcontext, gen_special_features, + ifcontext, ) from .schema import ( QAPISchema,scripts/qapi/pylintrc +0
-4@@ -34,16 +34,11 @@ disable=fixme, [BASIC] -# Good variable names which should always be accepted, separated by a comma. -good-names=i, - j, - k,
scripts/qapi/pylintrc disable=fixme, · line 40
Quoted 10 lines
scripts/qapi/pylintrc +4
-6- 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 + +# Allow just about anything, as per Markus's preference.
Does it still flag PEP-8 violations like all lower case class names?
If yes, "just about any length" is more precise.
Quoted 38 lines
scripts/qapi/pylintrc +1
-0+good-names-rgxs=^[_a-z][_a-z0-9]?$ [VARIABLES]scripts/qapi/types.py +5
-1@@ -16,7 +16,11 @@ 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,scripts/qapi/visit.py +5
-1@@ -21,7 +21,11 @@ indent, mcgen, ) -from .gen import QAPISchemaModularCVisitor, gen_special_features, ifcontext +from .gen import ( + QAPISchemaModularCVisitor, + gen_special_features, + ifcontext, +) from .schema import ( QAPISchema, QAPISchemaEnumMember,
Markus Armbruster
Reviewed-byQuoted 34 lines · Markus Armbruster
Quoted 32 lines · John Snow
Get isort and pylint tools passing again.
Signed-off-by John Snow <[email protected]>--- scripts/qapi/commands.py | 2 +- scripts/qapi/pylintrc | 15 +++++---------- scripts/qapi/types.py | 6 +++++- scripts/qapi/visit.py | 6 +++++- 4 files changed, 16 insertions(+), 13 deletions(-)scripts/qapi/commands.py +1
-1@@ -25,8 +25,8 @@ QAPIGenC, QAPISchemaModularCVisitor, build_params, - ifcontext, gen_special_features, + ifcontext, ) from .schema import ( QAPISchema,scripts/qapi/pylintrc +0
-0@@ -34,16 +34,11 @@ disable=fixme, [BASIC]
Quoted 16 lines
Quoted 4 lines
scripts/qapi/pylintrc +0
-4-# Good variable names which should always be accepted, separated by a comma. -good-names=i, - j, - k,scripts/qapi/pylintrc disable=fixme, · line 40
Quoted 10 lines
scripts/qapi/pylintrc +4
-6- 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 + +# Allow just about anything, as per Markus's preference.Does it still flag PEP-8 violations like all lower case class names?
Looks like it in my tests.
Quoted 1 line
If yes, "just about any length" is more precise.
I'll change the comment if you don't mind:
# Suppress complaints about short names. PEP-8 is cool with them, # and so are we.
With that:
Reviewed-by Markus Armbruster <[email protected]>
No respin necessary.
Markus Armbruster
AppliedQueued, thanks!