qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: Michael Roth <michael.roth@amd.com>, John Snow <jsnow@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Cleber Rosa <crosa@redhat.com>
Subject: [PATCH v5 00/17] qapi: static typing conversion, pt3
Date: Wed, 21 Apr 2021 14:20:15 -0400	[thread overview]
Message-ID: <20210421182032.3521476-1-jsnow@redhat.com> (raw)

Hi, this series adds static types to the QAPI module.
This is part three, and it focuses on expr.py.

Environment:
- Python >= 3.6, <= 3.8 *
- mypy >= 0.770
- pylint >= 2.6.0
- flake8
- isort

Every commit should pass with (from ./scripts/):
 - flake8 qapi/
 - pylint --rcfile=qapi/pylintrc qapi/
 - mypy --config-file=qapi/mypy.ini qapi/
 - pushd qapi && isort -c . && popd

V5:

001/17:[----] [--] 'qapi/expr: Comment cleanup'
002/19: -DROPPED-  'flake8: Enforce shorter line length for comments and docstrings'
002/17:[----] [--] 'qapi/expr.py: Remove 'info' argument from nested check_if_str'
003/17:[----] [--] 'qapi/expr.py: Check for dict instead of OrderedDict'
004/17:[0006] [FC] 'qapi/expr.py: constrain incoming expression types'
005/17:[----] [--] 'qapi/expr.py: Add assertion for union type 'check_dict''
006/17:[----] [--] 'qapi/expr.py: move string check upwards in check_type'
007/17:[down]      'qapi/expr.py: Check type of union and alternate 'data' member'
008/19: -MERGED- ^ 'qapi: add tests for invalid 'data' field type'
009/19: -MERGED- ^ 'qapi/expr.py: Check type of 'data' member'
008/17:[0004] [FC] 'qapi/expr.py: Add casts in a few select cases'
009/17:[----] [--] 'qapi/expr.py: Modify check_keys to accept any Collection'
010/17:[----] [-C] 'qapi/expr.py: add type hint annotations'
011/17:[0013] [FC] 'qapi/expr.py: Consolidate check_if_str calls in check_if'
012/17:[----] [--] 'qapi/expr.py: Remove single-letter variable'
013/17:[----] [--] 'qapi/expr.py: enable pylint checks'
014/17:[down]      'qapi/expr: Only explicitly prohibit 'Kind' nor 'List' for type names'
015/17:[0227] [FC] 'qapi/expr.py: Add docstrings'
016/17:[----] [-C] 'qapi/expr.py: Use tuples instead of lists for static data'
017/17:[down]      'qapi/expr: Update authorship and copyright information'
018/19: -DROPPED-  'qapi/expr.py: move related checks inside check_xxx functions'
019/19: -DROPPED-  'qapi/expr.py: Use an expression checker dispatch table'

- Dropped what was 02, 18, 19.
- Merged what was 08, 09 into what is now 07.
- 04: Expanded comment for _JSONObject type alias.
- 07: "New", combines the fix and the test patches from the previous series into
      one patch.
- 08: Fixed spelling of "Checked" from "Asserted"
- 11: Reverted back to Python2 style string interpolation
- 14: New, fix the code to reflect the docs for Kind/List reservations.
- 15: Many, many docstring changes. (Too many to list!)
- 17: New, update copyright/authorship. (Could be folded into 15 if desired,
      as that's what I'm claiming credit for.)

John Snow (17):
  qapi/expr: Comment cleanup
  qapi/expr.py: Remove 'info' argument from nested check_if_str
  qapi/expr.py: Check for dict instead of OrderedDict
  qapi/expr.py: constrain incoming expression types
  qapi/expr.py: Add assertion for union type 'check_dict'
  qapi/expr.py: move string check upwards in check_type
  qapi/expr.py: Check type of union and alternate 'data' member
  qapi/expr.py: Add casts in a few select cases
  qapi/expr.py: Modify check_keys to accept any Collection
  qapi/expr.py: add type hint annotations
  qapi/expr.py: Consolidate check_if_str calls in check_if
  qapi/expr.py: Remove single-letter variable
  qapi/expr.py: enable pylint checks
  qapi/expr: Only explicitly prohibit 'Kind' nor 'List' for type names
  qapi/expr.py: Add docstrings
  qapi/expr.py: Use tuples instead of lists for static data
  qapi/expr: Update authorship and copyright information

 scripts/qapi/expr.py                          | 444 +++++++++++++++---
 scripts/qapi/mypy.ini                         |   5 -
 scripts/qapi/pylintrc                         |   1 -
 tests/qapi-schema/alternate-data-invalid.err  |   2 +
 tests/qapi-schema/alternate-data-invalid.json |   4 +
 tests/qapi-schema/alternate-data-invalid.out  |   0
 tests/qapi-schema/meson.build                 |   2 +
 tests/qapi-schema/union-invalid-data.err      |   2 +
 tests/qapi-schema/union-invalid-data.json     |   6 +
 tests/qapi-schema/union-invalid-data.out      |   0
 10 files changed, 385 insertions(+), 81 deletions(-)
 create mode 100644 tests/qapi-schema/alternate-data-invalid.err
 create mode 100644 tests/qapi-schema/alternate-data-invalid.json
 create mode 100644 tests/qapi-schema/alternate-data-invalid.out
 create mode 100644 tests/qapi-schema/union-invalid-data.err
 create mode 100644 tests/qapi-schema/union-invalid-data.json
 create mode 100644 tests/qapi-schema/union-invalid-data.out

-- 
2.30.2




             reply	other threads:[~2021-04-21 18:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 18:20 John Snow [this message]
2021-04-21 18:20 ` [PATCH v5 01/17] qapi/expr: Comment cleanup John Snow
2021-04-21 18:20 ` [PATCH v5 02/17] qapi/expr.py: Remove 'info' argument from nested check_if_str John Snow
2021-04-21 18:20 ` [PATCH v5 03/17] qapi/expr.py: Check for dict instead of OrderedDict John Snow
2021-04-21 18:20 ` [PATCH v5 04/17] qapi/expr.py: constrain incoming expression types John Snow
2021-04-21 18:20 ` [PATCH v5 05/17] qapi/expr.py: Add assertion for union type 'check_dict' John Snow
2021-04-21 18:20 ` [PATCH v5 06/17] qapi/expr.py: move string check upwards in check_type John Snow
2021-04-21 18:20 ` [PATCH v5 07/17] qapi/expr.py: Check type of union and alternate 'data' member John Snow
2021-04-21 18:20 ` [PATCH v5 08/17] qapi/expr.py: Add casts in a few select cases John Snow
2021-04-21 18:20 ` [PATCH v5 09/17] qapi/expr.py: Modify check_keys to accept any Collection John Snow
2021-04-21 18:20 ` [PATCH v5 10/17] qapi/expr.py: add type hint annotations John Snow
2021-04-21 18:20 ` [PATCH v5 11/17] qapi/expr.py: Consolidate check_if_str calls in check_if John Snow
2021-04-21 18:20 ` [PATCH v5 12/17] qapi/expr.py: Remove single-letter variable John Snow
2021-04-21 18:20 ` [PATCH v5 13/17] qapi/expr.py: enable pylint checks John Snow
2021-04-21 18:20 ` [PATCH v5 14/17] qapi/expr: Only explicitly prohibit 'Kind' nor 'List' for type names John Snow
2021-04-21 18:20 ` [PATCH v5 15/17] qapi/expr.py: Add docstrings John Snow
2021-04-21 18:20 ` [PATCH v5 16/17] qapi/expr.py: Use tuples instead of lists for static data John Snow
2021-04-21 18:20 ` [PATCH v5 17/17] qapi/expr: Update authorship and copyright information John Snow
2021-04-22  7:07 ` [PATCH v5 00/17] qapi: static typing conversion, pt3 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=20210421182032.3521476-1-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=crosa@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).