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

John Snow posted 13 patches 4 years, 4 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210929194428.1038496-1-jsnow@redhat.com
Maintainers: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>
There is a newer version of this series
qapi/block-core.json                          |   1 +
qga/qapi-schema.json                          |   3 +
scripts/qapi/gen.py                           |   3 +-
scripts/qapi/mypy.ini                         |   5 -
scripts/qapi/parser.py                        | 161 +++++++++++-------
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 +
.../doc-whitespace-leading-symbol.err         |   1 +
.../doc-whitespace-leading-symbol.json        |   6 +
.../doc-whitespace-leading-symbol.out         |   0
.../doc-whitespace-trailing-symbol.err        |   1 +
.../doc-whitespace-trailing-symbol.json       |   6 +
.../doc-whitespace-trailing-symbol.out        |   0
tests/qapi-schema/meson.build                 |   2 +
16 files changed, 134 insertions(+), 71 deletions(-)
create mode 100644 tests/qapi-schema/doc-whitespace-leading-symbol.err
create mode 100644 tests/qapi-schema/doc-whitespace-leading-symbol.json
create mode 100644 tests/qapi-schema/doc-whitespace-leading-symbol.out
create mode 100644 tests/qapi-schema/doc-whitespace-trailing-symbol.err
create mode 100644 tests/qapi-schema/doc-whitespace-trailing-symbol.json
create mode 100644 tests/qapi-schema/doc-whitespace-trailing-symbol.out
[PATCH v3 00/13] qapi: static typing conversion, pt5b
Posted by John Snow 4 years, 4 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/379678153
    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/`

V3:

001/13:[down] 'qapi/pylintrc: ignore 'consider-using-f-string' warning'
002/13:[down] 'qapi/gen: use dict.items() to iterate over _modules'
003/13:[----] [--] 'qapi/parser: fix unused check_args_section arguments'
004/13:[down] 'qapi: Add spaces after symbol declaration for consistency'
005/13:[down] 'qapi/parser: improve detection of '@symbol:' preface'
006/13:[down] 'qapi/parser: remove FIXME comment from _append_body_line'
007/13:[down] 'qapi/parser: Simplify _end_section()'
008/13:[down] 'qapi/parser: Introduce NullSection'
009/13:[down] 'qapi/parser: add import cycle workaround'
010/13:[0028] [FC] 'qapi/parser: add type hint annotations (QAPIDoc)'
011/13:[----] [--] 'qapi/parser: enable mypy checks'
012/13:[0003] [FC] 'qapi/parser: Silence too-few-public-methods warning'
013/13:[----] [--] 'qapi/parser: enable pylint checks'

- Rebased.
- Add patches 1 & 2 for newer pylint versions
- Add patches 4-6 because I was in the neighborhood
- Patches 7 & 8 rewritten from the corpse of the prior fix/workaround
- Patch 9 split out separately from what is now patch 10
- Update patch 12 to accommodate new 7/8

Notes:
- Patches 4-6 aren't crucial and can be omitted from staging if it makes
  the difference between a respin or not. I think I will definitely want
  patches 5-6 eventually anyway, though. (Or something to replace 'em.)
- Patch 10 and 11 can be squashed, if desired

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: improve detection of '@symbol:' preface
  qapi/parser: remove FIXME comment from _append_body_line
  qapi/parser: Simplify _end_section()
  qapi/parser: Introduce NullSection
  qapi/parser: add import cycle workaround
  qapi/parser: add type hint annotations (QAPIDoc)
  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                        | 161 +++++++++++-------
 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 +
 .../doc-whitespace-leading-symbol.err         |   1 +
 .../doc-whitespace-leading-symbol.json        |   6 +
 .../doc-whitespace-leading-symbol.out         |   0
 .../doc-whitespace-trailing-symbol.err        |   1 +
 .../doc-whitespace-trailing-symbol.json       |   6 +
 .../doc-whitespace-trailing-symbol.out        |   0
 tests/qapi-schema/meson.build                 |   2 +
 16 files changed, 134 insertions(+), 71 deletions(-)
 create mode 100644 tests/qapi-schema/doc-whitespace-leading-symbol.err
 create mode 100644 tests/qapi-schema/doc-whitespace-leading-symbol.json
 create mode 100644 tests/qapi-schema/doc-whitespace-leading-symbol.out
 create mode 100644 tests/qapi-schema/doc-whitespace-trailing-symbol.err
 create mode 100644 tests/qapi-schema/doc-whitespace-trailing-symbol.json
 create mode 100644 tests/qapi-schema/doc-whitespace-trailing-symbol.out

-- 
2.31.1



Re: [PATCH v3 00/13] qapi: static typing conversion, pt5b
Posted by Markus Armbruster 4 years, 4 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.

Looks basically ready except for PATCH 5, which we can chop off (I
think), so you don't have to respin the whole series.

"Basically" means we may want to tweak a few commit messages /
comments.  Happy to do that myself.