qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	Michael Roth <michael.roth@amd.com>,
	Markus Armbruster <armbru@redhat.com>,
	Eric Blake <eblake@redhat.com>, Cleber Rosa <crosa@redhat.com>,
	John Snow <jsnow@redhat.com>
Subject: [PATCH v3 00/13] qapi: static typing conversion, pt5b
Date: Wed, 29 Sep 2021 15:44:15 -0400	[thread overview]
Message-ID: <20210929194428.1038496-1-jsnow@redhat.com> (raw)

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




             reply	other threads:[~2021-09-29 19:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 19:44 John Snow [this message]
2021-09-29 19:44 ` [PATCH v3 01/13] qapi/pylintrc: ignore 'consider-using-f-string' warning John Snow
2021-09-29 19:44 ` [PATCH v3 02/13] qapi/gen: use dict.items() to iterate over _modules John Snow
2021-09-29 19:44 ` [PATCH v3 03/13] qapi/parser: fix unused check_args_section arguments John Snow
2021-09-29 19:44 ` [PATCH v3 04/13] qapi: Add spaces after symbol declaration for consistency John Snow
2021-09-29 19:44 ` [PATCH v3 05/13] qapi/parser: improve detection of '@symbol:' preface John Snow
2021-09-30  8:42   ` Markus Armbruster
2021-09-30 17:43     ` John Snow
2021-09-29 19:44 ` [PATCH v3 06/13] qapi/parser: remove FIXME comment from _append_body_line John Snow
2021-09-30  8:47   ` Markus Armbruster
2021-09-30 17:20     ` John Snow
2021-09-29 19:44 ` [PATCH v3 07/13] qapi/parser: Simplify _end_section() John Snow
2021-09-29 19:44 ` [PATCH v3 08/13] qapi/parser: Introduce NullSection John Snow
2021-09-30  9:34   ` Markus Armbruster
2021-09-30 16:59     ` John Snow
2021-09-29 19:44 ` [PATCH v3 09/13] qapi/parser: add import cycle workaround John Snow
2021-09-30  9:45   ` Markus Armbruster
2021-09-30 17:11     ` John Snow
2021-09-29 19:44 ` [PATCH v3 10/13] qapi/parser: add type hint annotations (QAPIDoc) John Snow
2021-09-29 19:44 ` [PATCH v3 11/13] qapi/parser: enable mypy checks John Snow
2021-09-29 19:44 ` [PATCH v3 12/13] qapi/parser: Silence too-few-public-methods warning John Snow
2021-09-29 19:44 ` [PATCH v3 13/13] qapi/parser: enable pylint checks John Snow
2021-09-30 10:08 ` [PATCH v3 00/13] qapi: static typing conversion, pt5b Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210929194428.1038496-1-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).