qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/26] qapi: static typing conversion, pt5
@ 2020-09-22 22:34 John Snow
  2020-09-22 22:35 ` [PATCH 01/26] qapi/parser.py: refactor parsing routine into method John Snow
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: John Snow @ 2020-09-22 22:34 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Cleber Rosa, John Snow, qemu-devel, Eduardo Habkost, Michael Roth

based-on: <20200922210101.4081073-1-jsnow@redhat.com>
          [PATCH 0/6] qapi: static typing conversion, pt4

Hi, this series adds static type hints to the QAPI module.
This is part five!

Part 5: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt5
Everything: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt6

- Requires Python 3.6+
- Requires mypy 0.770 or newer (for type analysis only)
- Requires pylint 2.6.0 or newer (for lint checking only)

This part of the series focuses on just parser.py.

Type hints are added in patches that add *only* type hints and change no
other behavior. Any necessary changes to behavior to accommodate typing
are split out into their own tiny patches.

Every commit should pass with:
 - flake8 qapi/
 - pylint --rcfile=qapi/pylintrc qapi/
 - mypy --config-file=qapi/mypy.ini qapi/

John Snow (26):
  qapi/parser.py: refactor parsing routine into method
  qapi/parser.py: group variable declarations in __init__
  qapi/parser.py: use 'with' statement for opening files
  qapi/source.py: Add default arguments to QAPISourceInfo
  qapi/parser.py: start source info at line 0
  qapi/parser.py: raise QAPIParseError during file opening
  qapi/parser.py: fully remove 'null' constant
  qapi/parser.py: Assert lexer value is a string
  qapi/parser.py: assert get_expr returns object in outer loop
  qapi/parser.py: assert object keys are strings
  qapi/parser.py: Convert several methods to @classmethod
  qapi/parser.py: add casts to pragma checks
  qapi/parser.py: add type hint annotations
  qapi/parser.py: add docstrings
  qapi/parser.py: add ParsedExpression type
  qapi/pragma.py: Move QAPISchemaPragma into its own module
  qapi/pragma.py: Move pragma parsing out of parser.py
  qapi/parser.py: Modify _include() to use parser state
  qapi/parser.py: add parent argument
  qapi/parser.py: remove unused check_args_section arguments
  qapi/parser.py: QAPIDoc: convert @staticmethod to @classmethod
  qapi/parser.py: add type hint annotations (QAPIDoc)
  qapi/parser.py: enable mypy checks
  qapi/parser.py: remove one and two-letter variables
  qapi/parser.py: Silence too-few-public-methods warning
  qapi/parser.py: enable pylint checks

 scripts/qapi/error.py                     |   8 +-
 scripts/qapi/expr.py                      |  56 ++--
 scripts/qapi/mypy.ini                     |   5 -
 scripts/qapi/parser.py                    | 322 +++++++++++++---------
 scripts/qapi/pragma.py                    |  68 +++++
 scripts/qapi/pylintrc                     |   3 +-
 scripts/qapi/schema.py                    |   6 +-
 scripts/qapi/source.py                    |  22 +-
 tests/qapi-schema/leading-comma-list.err  |   2 +-
 tests/qapi-schema/trailing-comma-list.err |   2 +-
 10 files changed, 301 insertions(+), 193 deletions(-)
 create mode 100644 scripts/qapi/pragma.py

-- 
2.26.2




^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2020-09-22 23:10 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-22 22:34 [PATCH 00/26] qapi: static typing conversion, pt5 John Snow
2020-09-22 22:35 ` [PATCH 01/26] qapi/parser.py: refactor parsing routine into method John Snow
2020-09-22 22:35 ` [PATCH 02/26] qapi/parser.py: group variable declarations in __init__ John Snow
2020-09-22 22:35 ` [PATCH 03/26] qapi/parser.py: use 'with' statement for opening files John Snow
2020-09-22 22:35 ` [PATCH 04/26] qapi/source.py: Add default arguments to QAPISourceInfo John Snow
2020-09-22 22:35 ` [PATCH 05/26] qapi/parser.py: start source info at line 0 John Snow
2020-09-22 22:35 ` [PATCH 06/26] qapi/parser.py: raise QAPIParseError during file opening John Snow
2020-09-22 22:35 ` [PATCH 07/26] qapi/parser.py: fully remove 'null' constant John Snow
2020-09-22 22:35 ` [PATCH 08/26] qapi/parser.py: Assert lexer value is a string John Snow
2020-09-22 22:35 ` [PATCH 09/26] qapi/parser.py: assert get_expr returns object in outer loop John Snow
2020-09-22 22:35 ` [PATCH 10/26] qapi/parser.py: assert object keys are strings John Snow
2020-09-22 22:35 ` [PATCH 11/26] qapi/parser.py: Convert several methods to @classmethod John Snow
2020-09-22 22:35 ` [PATCH 12/26] qapi/parser.py: add casts to pragma checks John Snow
2020-09-22 22:35 ` [PATCH 13/26] qapi/parser.py: add type hint annotations John Snow
2020-09-22 22:35 ` [PATCH 14/26] qapi/parser.py: add docstrings John Snow
2020-09-22 22:35 ` [PATCH 15/26] qapi/parser.py: add ParsedExpression type John Snow
2020-09-22 22:35 ` [PATCH 16/26] qapi/pragma.py: Move QAPISchemaPragma into its own module John Snow
2020-09-22 22:35 ` [PATCH 17/26] qapi/pragma.py: Move pragma parsing out of parser.py John Snow
2020-09-22 22:35 ` [PATCH 18/26] qapi/parser.py: Modify _include() to use parser state John Snow
2020-09-22 22:35 ` [PATCH 19/26] qapi/parser.py: add parent argument John Snow
2020-09-22 22:35 ` [PATCH 20/26] qapi/parser.py: remove unused check_args_section arguments John Snow
2020-09-22 22:35 ` [PATCH 21/26] qapi/parser.py: QAPIDoc: convert @staticmethod to @classmethod John Snow
2020-09-22 22:35 ` [PATCH 22/26] qapi/parser.py: add type hint annotations (QAPIDoc) John Snow
2020-09-22 22:35 ` [PATCH 23/26] qapi/parser.py: enable mypy checks John Snow
2020-09-22 22:35 ` [PATCH 24/26] qapi/parser.py: remove one and two-letter variables John Snow
2020-09-22 22:35 ` [PATCH 25/26] qapi/parser.py: Silence too-few-public-methods warning John Snow
2020-09-22 22:35 ` [PATCH 26/26] qapi/parser.py: enable pylint checks John Snow
2020-09-22 22:54 ` [PATCH 00/26] qapi: static typing conversion, pt5 John Snow

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).