[PATCH v4 00/13] qapi: static typing conversion, pt5b

John Snow posted 13 patches 2 years, 7 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210930205716.1148693-1-jsnow@redhat.com
Maintainers: Markus Armbruster <armbru@redhat.com>, Eric Blake <eblake@redhat.com>, Michael Roth <michael.roth@amd.com>
qapi/block-core.json                   |   1 +
qga/qapi-schema.json                   |   3 +
scripts/qapi/gen.py                    |   3 +-
scripts/qapi/mypy.ini                  |   5 -
scripts/qapi/parser.py                 | 152 ++++++++++++++++---------
scripts/qapi/pylintrc                  |   4 +-
tests/qapi-schema/doc-bad-feature.err  |   2 +-
tests/qapi-schema/doc-empty-symbol.err |   2 +-
tests/qapi-schema/doc-good.json        |   8 ++
9 files changed, 114 insertions(+), 66 deletions(-)
[PATCH v4 00/13] qapi: static typing conversion, pt5b
Posted by John Snow 2 years, 7 months ago
Hello darkness my old friend; This is part five (b), and focuses on
QAPIDoc in parser.py.

GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-qapi-cleanup-pt5b
CI: https://gitlab.com/jsnow/qemu/-/pipelines/380464863
    Note: intentional trailing whitespace in a QAPI schema test causes
    a warning on the `check-patch` CI test. Ignore it.

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/`

V4:

005/13:[0006] [FC] 'qapi/parser: remove FIXME comment from _append_body_line'
006/13:[down] 'qapi/parser: clarify _end_section() logic'
007/13:[0004] [FC] 'qapi/parser: Introduce NullSection'
010/13:[down] 'qapi/parser: Add FIXME for consolidating JSON-related types'

- Dropped formerly-patch-05, for now.
- Added a new FIXME comment to keep myself honest for pt5c O:-)
- (05) Adjusted a commend and the parser error message
- (06) Changed commit title for 06 ("simplify" => "clarify")
- (07) Adjust comment.

John Snow (13):
  qapi/pylintrc: ignore 'consider-using-f-string' warning
  qapi/gen: use dict.items() to iterate over _modules
  qapi/parser: fix unused check_args_section arguments
  qapi: Add spaces after symbol declaration for consistency
  qapi/parser: remove FIXME comment from _append_body_line
  qapi/parser: clarify _end_section() logic
  qapi/parser: Introduce NullSection
  qapi/parser: add import cycle workaround
  qapi/parser: add type hint annotations (QAPIDoc)
  qapi/parser: Add FIXME for consolidating JSON-related types
  qapi/parser: enable mypy checks
  qapi/parser: Silence too-few-public-methods warning
  qapi/parser: enable pylint checks

 qapi/block-core.json                   |   1 +
 qga/qapi-schema.json                   |   3 +
 scripts/qapi/gen.py                    |   3 +-
 scripts/qapi/mypy.ini                  |   5 -
 scripts/qapi/parser.py                 | 152 ++++++++++++++++---------
 scripts/qapi/pylintrc                  |   4 +-
 tests/qapi-schema/doc-bad-feature.err  |   2 +-
 tests/qapi-schema/doc-empty-symbol.err |   2 +-
 tests/qapi-schema/doc-good.json        |   8 ++
 9 files changed, 114 insertions(+), 66 deletions(-)

-- 
2.31.1



Re: [PATCH v4 00/13] qapi: static typing conversion, pt5b
Posted by Markus Armbruster 2 years, 6 months ago
John Snow <jsnow@redhat.com> writes:

> Hello darkness my old friend; This is part five (b), and focuses on
> QAPIDoc in parser.py.

Series:
Reviewed-by: Markus Armbruster <armbru@redhat.com>


Re: [PATCH v4 00/13] qapi: static typing conversion, pt5b
Posted by Markus Armbruster 2 years, 6 months ago
Markus Armbruster <armbru@redhat.com> writes:

> John Snow <jsnow@redhat.com> writes:
>
>> Hello darkness my old friend; This is part five (b), and focuses on
>> QAPIDoc in parser.py.
>
> Series:
> Reviewed-by: Markus Armbruster <armbru@redhat.com>

... and queued.  Thanks!