Skip to content

qapi: static typing conversion, pt4

John Snow qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6qapi/error.py: refactor error classesscripts/qapi/error.py scripts/qapi/main.py scripts/qapi/schema.py+26 -150 replies
2/6qapi/parser.py: remove parser context from QAPIDocscripts/qapi/parser.py+30 -260 replies
3/6qapi/error.py: move QAPIParseError to parser.pyscripts/qapi/error.py scripts/qapi/parser.py+13 -130 replies
4/6qapi/parser.py: refactor QAPIParseErrorscripts/qapi/parser.py+31 -270 replies
5/6qapi/error.py: enable mypy checksscripts/qapi/mypy.ini+0 -50 replies
6/6qapi/error.py: enable pylint checksscripts/qapi/pylintrc+1 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] qapi: static typing conversion, pt4

based-on: <[email protected]>
[PATCH 00/14] qapi: static typing conversion, pt3

Hi, this series adds static type hints to the QAPI module. This is part four!

Part 4: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt4
Everything: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt6

- Requires Python 3.6+
- Requires mypy 0.770 or newer (for type analysis only)
- Requires pylint 2.6.0 or newer (for lint checking only)

This part of the series focuses on error.py.

Type hints are added in patches that add *only* type hints and change no other behavior. Any necessary changes to behavior to accommodate typing are split out into their own tiny patches.

Every commit should pass with:
- flake8 qapi/
- pylint --rcfile=qapi/pylintrc qapi/
- mypy --config-file=qapi/mypy.ini qapi/

John Snow (6):
qapi/error.py: refactor error classes qapi/parser.py: remove parser context from QAPIDoc qapi/error.py: move QAPIParseError to parser.py qapi/parser.py: refactor QAPIParseError qapi/error.py: enable mypy checks qapi/error.py: enable pylint checks

 scripts/qapi/error.py  |  41 +++++++-------
 scripts/qapi/main.py   |   2 +-
 scripts/qapi/mypy.ini  |   5 --
 scripts/qapi/parser.py | 120 ++++++++++++++++++++++++-----------------
 scripts/qapi/pylintrc  |   3 +-
 scripts/qapi/schema.py |   4 +-
 6 files changed, 94 insertions(+), 81 deletions(-)
Signature · 1 line
2.26.2