qapi: static typing conversion, pt5a
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest15 patches 3 repliesIn review
- v221 patches 15 repliesSuperseded
- v122 patches 44 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/15 | qapi/parser: Don't try to handle file errorsscripts/ scripts/ scripts/ +1 more | +18 | 0 replies | |
| 2/15 | qapi: Add test for nonexistent schema filetests/ tests/ tests/ | +7 | 0 replies | |
| 3/15 | qapi/source: Remove line number from QAPISourceInfo initializerscripts/ scripts/ | +4 | 0 replies | |
| 4/15 | qapi/parser: factor parsing routine into methodscripts/ | +28 | 0 replies | |
| 5/15 | qapi/parser: Assert lexer value is a stringscripts/ | +1 | 0 replies | |
| 6/15 | qapi/parser: enforce all top-level expressions must be dict in _parse()scripts/ tests/ tests/ | +10 | 0 replies | |
| 7/15 | qapi/parser: assert object keys are stringsscripts/ | +2 | 0 replies | |
| 8/15 | qapi/parser: Use @staticmethod where appropriatescripts/ | +4 | 0 replies | |
| 9/15 | qapi: add must_match helperscripts/ scripts/ scripts/ | +16 | 0 replies | |
| 10/15 | qapi/parser: Fix token membership tests when token can be Nonescripts/ tests/ tests/ +5 more | +9 | 0 replies | |
| 11/15 | qapi/parser: Rework _check_pragma_list_of_str as a TypeGuardscripts/ | +16 | 0 replies | |
| 12/15 | qapi/parser: add type hint annotationsscripts/ | +38 | 0 replies | |
| 13/15 | qapi/parser: Remove superfluous list comprehensionscripts/ | +1 | 0 replies | |
| 14/15 | qapi/parser: allow 'ch' variable namescripts/ | +1 | 2 replies | |
| 15/15 | qapi/parser: add docstringsscripts/ | +69 | 0 replies |
Reviews trailers per patch
None of the 15 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Markus Armbruster |
|---|---|
| Series | R-b |
| 1/15 | |
| 2/15 | |
| 3/15 | |
| 4/15 | |
| 5/15 | |
| 6/15 | |
| 7/15 | |
| 8/15 | |
| 9/15 | |
| 10/15 | |
| 11/15 | |
| 12/15 | |
| 13/15 | |
| 14/15 | |
| 15/15 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 00/15] qapi: static typing conversion, pt5a
This is part five (a), and focuses on QAPISchemaParser in parser.py. It does not touch QAPIDoc yet, which will be covered next.
gitlab: https://gitlab.com/jsnow/qemu/-/commits/python-qapi-cleanup-pt5a
Requirements:
- Python 3.6+
- mypy >= 0.770
- pylint >= 2.6.0 (2.7.0+ when using Python 3.9+)
Every commit should pass with:
- isort -c qapi/
- flake8 qapi/
- pylint --rcfile=qapi/pylintrc qapi/
- mypy --config-file=qapi/mypy.ini qapi/
V3:
001: Commit message changed
004: Commit message changed
005/15:[0002] [FC] 'qapi/parser: Assert lexer value is a string'
- Remove comment
015/15:[0019] [FC] 'qapi/parser: add docstrings'
- Futz with docstrings based on review from armbru
V2:
001/21:[0024] [FC] 'qapi/parser: Don't try to handle file errors' 002/21:[down] 'qapi: Add test for nonexistent schema file'
003/21:[0008] [FC] 'qapi/source: Remove line number from QAPISourceInfo initializer' 004/21:[0003] [FC] 'qapi/parser: factor parsing routine into method' 005/21:[0002] [FC] 'qapi/parser: Assert lexer value is a string' 006/21:[down] 'qapi/parser: enforce all top-level expressions must be dict in _parse()' 007/21:[----] [--] 'qapi/parser: assert object keys are strings' 008/21:[----] [--] 'qapi/parser: Use @staticmethod where appropriate' 009/21:[down] 'qapi: add must_match helper'
010/21:[down] 'qapi/parser: Fix token membership tests when token can be None' 011/21:[0012] [FC] 'qapi/parser: Rework _check_pragma_list_of_str as a TypeGuard' 012/21:[0019] [FC] 'qapi/parser: add type hint annotations'
013/21:[down] 'qapi/parser: Remove superfluous list comprehension' 014/21:[----] [--] 'qapi/parser: allow 'ch' variable name'
015/21:[0080] [FC] 'qapi/parser: add docstrings'
01:
- Futzed with the commit message a lot.
- Added new try/except to QAPISchema() instead of main().
- Adjusted "let caller handle this error" comment
- Adjusted test-qapi not to crash.
02:
- New, add test for nonexistant root schema file.
03:
- Commit message changes.
- Rebase changes, removed _column RFC patch that preceded it.
04:
- Commit message changes.
- Minor rebase changes (from changed comment in 01)
05:
- Remove assert message, replace w/ comment
06:
- Replaces 'qapi/parser: assert get_expr returns object in outer loop'
09:
- Renamed match_nofail() to must_match()
10:
- Use tuple() for token membership tests
- Add test cases to prevent regressions
11:
- _check => _check_list_str
- info.pragma => pragma
12:
- Remove 'Expression' type entirely for now
- Highlight self.tok as actively taking None type with Union[str, None]
- Minor rebase confetti.
13:
- Renamed commit message.
15:
- Reworked.
- Note that 'pos' is indeed interface as it is used by the error handlers.
John Snow (15):
qapi/parser: Don't try to handle file errors
qapi: Add test for nonexistent schema file qapi/source: Remove line number from QAPISourceInfo initializer qapi/parser: factor parsing routine into method qapi/parser: Assert lexer value is a string qapi/parser: enforce all top-level expressions must be dict in
_parse()
qapi/parser: assert object keys are strings qapi/parser: Use @staticmethod where appropriate
qapi: add must_match helper
qapi/parser: Fix token membership tests when token can be None qapi/parser: Rework _check_pragma_list_of_str as a TypeGuard qapi/parser: add type hint annotations
qapi/parser: Remove superfluous list comprehension qapi/parser: allow 'ch' variable name
qapi/parser: add docstrings
scripts/qapi/common.py | 8 +- scripts/qapi/main.py | 6 +- scripts/qapi/parser.py | 230 +++++++++++++----- scripts/qapi/pylintrc | 1 + scripts/qapi/schema.py | 11 +- scripts/qapi/source.py | 13 +- tests/qapi-schema/meson.build | 9 +- tests/qapi-schema/missing-array-rsqb.err | 1 + tests/qapi-schema/missing-array-rsqb.json | 1 + tests/qapi-schema/missing-array-rsqb.out | 0 .../missing-object-member-element.err | 1 + .../missing-object-member-element.json | 1 + .../missing-object-member-element.out | 0 tests/qapi-schema/missing-schema.err | 1 + tests/qapi-schema/missing-schema.out | 0 tests/qapi-schema/non-objects.err | 2 +- tests/qapi-schema/quoted-structural-chars.err | 2 +- tests/qapi-schema/test-qapi.py | 3 - 18 files changed, 209 insertions(+), 81 deletions(-) create mode 100644 tests/qapi-schema/missing-array-rsqb.err create mode 100644 tests/qapi-schema/missing-array-rsqb.json create mode 100644 tests/qapi-schema/missing-array-rsqb.out create mode 100644 tests/qapi-schema/missing-object-member-element.err create mode 100644 tests/qapi-schema/missing-object-member-element.json create mode 100644 tests/qapi-schema/missing-object-member-element.out create mode 100644 tests/qapi-schema/missing-schema.err create mode 100644 tests/qapi-schema/missing-schema.out
Signature · 1 line
2.30.2