qapi: static typing conversion, pt5
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest26 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/26 | qapi/parser.py: refactor parsing routine into methodscripts/ | +18 | 0 replies | |
| 2/26 | qapi/parser.py: group variable declarations in __init__scripts/ | +7 | 0 replies | |
| 3/26 | qapi/parser.py: use 'with' statement for opening filesscripts/ | +2 | 0 replies | |
| 4/26 | qapi/source.py: Add default arguments to QAPISourceInfoscripts/ scripts/ | +6 | 0 replies | |
| 5/26 | qapi/parser.py: start source info at line 0scripts/ | +2 | 0 replies | |
| 6/26 | qapi/parser.py: raise QAPIParseError during file openingscripts/ | +7 | 0 replies | |
| 7/26 | qapi/parser.py: fully remove 'null' constantscripts/ tests/ tests/ | +6 | 0 replies | |
| 8/26 | qapi/parser.py: Assert lexer value is a stringscripts/ | +1 | 0 replies | |
| 9/26 | qapi/parser.py: assert get_expr returns object in outer loopscripts/ | +3 | 0 replies | |
| 10/26 | qapi/parser.py: assert object keys are stringsscripts/ | +2 | 0 replies | |
| 11/26 | qapi/parser.py: Convert several methods to @classmethodscripts/ | +6 | 0 replies | |
| 12/26 | qapi/parser.py: add casts to pragma checksscripts/ | +3 | 0 replies | |
| 13/26 | qapi/parser.py: add type hint annotationsscripts/ | +49 | 0 replies | |
| 14/26 | qapi/parser.py: add docstringsscripts/ | +38 | 0 replies | |
| 15/26 | qapi/parser.py: add ParsedExpression typescripts/ scripts/ scripts/ | +41 | 0 replies | |
| 16/26 | qapi/pragma.py: Move QAPISchemaPragma into its own modulescripts/ scripts/ | +27 | 0 replies | |
| 17/26 | qapi/pragma.py: Move pragma parsing out of parser.pyscripts/ scripts/ scripts/ | +59 | 0 replies | |
| 18/26 | qapi/parser.py: Modify _include() to use parser statescripts/ | +8 | 0 replies | |
| 19/26 | qapi/parser.py: add parent argumentscripts/ | +11 | 0 replies | |
| 20/26 | qapi/parser.py: remove unused check_args_section argumentsscripts/ | +3 | 0 replies | |
| 21/26 | qapi/parser.py: QAPIDoc: convert @staticmethod to @classmethodscripts/ | +2 | 0 replies | |
| 22/26 | qapi/parser.py: add type hint annotations (QAPIDoc)scripts/ | +38 | 0 replies | |
| 23/26 | qapi/parser.py: enable mypy checksscripts/ | +0 | 0 replies | |
| 24/26 | qapi/parser.py: remove one and two-letter variablesscripts/ | +15 | 0 replies | |
| 25/26 | qapi/parser.py: Silence too-few-public-methods warningscripts/ | +2 | 0 replies | |
| 26/26 | qapi/parser.py: enable pylint checksscripts/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/26] qapi: static typing conversion, pt5
based-on: <[email protected]>
[PATCH 0/6] qapi: static typing conversion, pt4
Hi, this series adds static type hints to the QAPI module. This is part five!
Part 5: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt5
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 just parser.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 (26):
qapi/parser.py: refactor parsing routine into method qapi/parser.py: group variable declarations in __init__ qapi/parser.py: use 'with' statement for opening files qapi/source.py: Add default arguments to QAPISourceInfo qapi/parser.py: start source info at line 0 qapi/parser.py: raise QAPIParseError during file opening qapi/parser.py: fully remove 'null' constant qapi/parser.py: Assert lexer value is a string qapi/parser.py: assert get_expr returns object in outer loop qapi/parser.py: assert object keys are strings qapi/parser.py: Convert several methods to @classmethod qapi/parser.py: add casts to pragma checks qapi/parser.py: add type hint annotations qapi/parser.py: add docstrings
qapi/parser.py: add ParsedExpression type qapi/pragma.py: Move QAPISchemaPragma into its own module qapi/pragma.py: Move pragma parsing out of parser.py qapi/parser.py: Modify _include() to use parser state qapi/parser.py: add parent argument
qapi/parser.py: remove unused check_args_section arguments qapi/parser.py: QAPIDoc: convert @staticmethod to @classmethod qapi/parser.py: add type hint annotations (QAPIDoc) qapi/parser.py: enable mypy checks
qapi/parser.py: remove one and two-letter variables qapi/parser.py: Silence too-few-public-methods warning qapi/parser.py: enable pylint checks
scripts/qapi/error.py | 8 +- scripts/qapi/expr.py | 56 ++-- scripts/qapi/mypy.ini | 5 - scripts/qapi/parser.py | 322 +++++++++++++--------- scripts/qapi/pragma.py | 68 +++++ scripts/qapi/pylintrc | 3 +- scripts/qapi/schema.py | 6 +- scripts/qapi/source.py | 22 +- tests/qapi-schema/leading-comma-list.err | 2 +- tests/qapi-schema/trailing-comma-list.err | 2 +- 10 files changed, 301 insertions(+), 193 deletions(-) create mode 100644 scripts/qapi/pragma.py
Signature · 1 line
2.26.2