was X command
introduced?", but possibly also to generate changelog QMP reports for
auditing QMP changes for each version during the release candidate window.
On Thu, Jun 6, 2024 at 6:25 AM Victor Toso wrote:
> Hi John!
>
> On Wed, Jun 05, 2024 at 11:47:53AM GMT, John Snow wrote:
>
On Thu, May 16, 2024 at 11:06 AM John Snow wrote:
>
>
> On Thu, May 16, 2024, 5:34 AM Markus Armbruster wrote:
>
>> John Snow writes:
>>
>> > Add a semantic tag to paragraphs that appear *before* tagged
>> > sections/members/features and those tha
On Thu, May 16, 2024 at 2:01 AM Markus Armbruster wrote:
> John Snow writes:
>
> > If a comment immediately follows a doc block, the parser doesn't ignore
> > that token appropriately. Fix that.
>
> Reproducer?
>
> >
> > Signed-off-by: John Snow
On Thu, May 16, 2024, 5:34 AM Markus Armbruster wrote:
> John Snow writes:
>
> > Add a semantic tag to paragraphs that appear *before* tagged
> > sections/members/features and those that appear after. This will control
> > how they are inlined when doc sections
On Thu, May 16, 2024, 2:18 AM Markus Armbruster wrote:
> John Snow writes:
>
> > When iterating all_sections, this is helpful to be able to distinguish
> > "members" from "features"; the only other way to do so is to
> > cross-reference these secti
On Thu, May 16, 2024, 1:58 AM Markus Armbruster wrote:
> John Snow writes:
>
> > Instead of using the info object for the doc block as a whole, update
> > the info pointer for each call to ensure_untagged_section when the
> > existing section is otherwise empty
On Wed, May 15, 2024, 1:27 PM Markus Armbruster wrote:
> John Snow writes:
>
> > On Wed, May 15, 2024 at 5:17 AM Markus Armbruster
> wrote:
> >
> >> John Snow writes:
> >>
> >> > In the coming patches, it's helpful to have a linting bas
On Wed, May 15, 2024 at 10:18 AM Markus Armbruster
wrote:
> John Snow writes:
>
> > On Wed, May 15, 2024, 7:50 AM Markus Armbruster
> wrote:
> >
> >> John Snow writes:
> >>
> >> > Prior to this patch, a section like this:
> &
On Wed, May 15, 2024 at 5:17 AM Markus Armbruster wrote:
> John Snow writes:
>
> > In the coming patches, it's helpful to have a linting baseline. However,
> > there's no need to shuffle around the deck chairs too much, because most
> > of this code will be remo
On Wed, May 15, 2024, 7:50 AM Markus Armbruster wrote:
> John Snow writes:
>
> > Prior to this patch, a section like this:
> >
> > @name: lorem ipsum
> >dolor sit amet
> > consectetur adipiscing elit
> >
> > would be parsed as:
>
On Wed, May 15, 2024, 5:17 AM Markus Armbruster wrote:
> John Snow writes:
>
> > In the coming patches, it's helpful to have a linting baseline. However,
> > there's no need to shuffle around the deck chairs too much, because most
> > of this code will be removed once t
Add a semantic tag to paragraphs that appear *before* tagged
sections/members/features and those that appear after. This will control
how they are inlined when doc sections are merged and flattened.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 22 +-
1 file changed
he objects that should be rendered *are*
by failing if any cross-references are missing, verifying everything is
in place.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 40
1 file changed, 40 insertions(+)
diff --git a/scripts/qapi/schema.py b/scripts/qapi
Transactions have the only instance of an Errors section that isn't a
rST list; turn it into one.
Signed-off-by: John Snow
---
qapi/transaction.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qapi/transaction.json b/qapi/transaction.json
index 5749c133d4a..07afc269d54
This helps simplify the doc generator if it doesn't have to check for
undocumented members.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index
Instead of using the info object for the doc block as a whole, update
the info pointer for each call to ensure_untagged_section when the
existing section is otherwise empty. This way, Sphinx error information
will match precisely to where the text actually starts.
Signed-off-by: John Snow
:
.. Note:: ...
.. admonition:: custom title
admonition body text
This patch uses ".. notes::" almost everywhere, with just two "caution"
directives. ".. admonition:: notes" is used in a few places where we had
an ordered list of multiple notes.
Signed-off-
Rewrite the StatsFilter intro paragraph to be more meaningful to
end-users when it is inlined in generated documentation.
Signed-off-by: John Snow
---
qapi/stats.json | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/qapi/stats.json b/qapi/stats.json
index 578b52c7ef7
If a comment immediately follows a doc block, the parser doesn't ignore
that token appropriately. Fix that.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 41b9319e5cb
ll_sections, we need *something* accessible to distinguish them.
To keep types simple, add this semantic parameter to the base Section
and not just ArgSection; we can use this to filter out paragraphs and
tagged sections, too.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 25 +
orry about that!
Signed-off-by: John Snow
---
scripts/qapi-lint.sh | 51 +++
scripts/qapi/Makefile | 5 +
2 files changed, 56 insertions(+)
create mode 100755 scripts/qapi-lint.sh
create mode 100644 scripts/qapi/Makefile
diff --git a/scripts/qapi
or rST.)
Signed-off-by: John Snow
---
docs/sphinx/qapidoc.py | 36 +-
scripts/qapi/parser.py | 8 ++--
tests/qapi-schema/doc-good.out | 32 +++---
3 files changed, 53 insertions(+), 23 deletions(-)
diff --git a/docs/sphinx/qapi
Fix minor irritants to pylint/flake8 et al.
(Yes, these need to be guarded by the Python tests. That's a work in
progress, a series that's quite likely to follow once I finish this
Sphinx project. Please pardon the temporary irritation.)
Signed-off-by: John Snow
---
scripts/qapi/introspect.py
aptions manually.
(Tedious, oh well.)
3. Add captions where still needed:
sed -zi 's|# .. code-block:: QMP\n#\n|# .. code-block:: QMP\n#:caption:
Example\n#\n|g' *.json
Not fully ideal, but hopefully not something that has to be done very
often. (Or ever aga
t;, so two examples have been adjusted to support that
format here.
Signed-off-by: John Snow
---
qapi/control.json | 3 ++-
qapi/machine.json | 2 +-
qapi/migration.json | 2 +-
qapi/misc.json | 3 ++-
qapi/net.json | 6 +++---
qapi/rocker.json| 2 +-
qapi/ui.json| 2 +
to *either*
audience, and convert what's left to garden-variety comments to prevent
it from showing up in rendered documentation.
Signed-off-by: John Snow
---
qapi/audio.json| 5 ++---
qapi/block-core.json | 47 ++
qapi/block-export.json | 10 -
Rephrase this paragraph so that it can apply to any commands that
inherit from this object.
Signed-off-by: John Snow
---
qapi/block-export.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qapi/block-export.json b/qapi/block-export.json
index dc328097a94
tall black" (without root permissions) if
you do not have it installed otherwise.
Signed-off-by: John Snow
---
docs/sphinx/qapidoc.py | 16 +---
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
index f270b494f01..165568
cleanup
Patches 4-12: QAPI generator fixes/miscellany
Patch 13: qapidoc.py fix (to prepare for rST conversion)
Patches 14-20: QAPI documentation modifications, rST conversion
Sorry,
--js
John Snow (20):
[DO-NOT-MERGE]: Add some ad-hoc linting helpers.
qapi: linter fixups
docs/qapidoc: delint
parsing an untagged section (free paragraphs), skip making a hollow
section and instead append the parse results to the prior section.
Many Bothans died to bring us this information.
Signed-off-by: John Snow
---
docs/sphinx/qapidoc.py | 16 +++-
1 file changed, 11 insertions(+), 5
else []:
...
against:
for var in variants or []:
...
Update callsites to reflect the new usage pattern.
Signed-off-by: John Snow
---
docs/sphinx/qapidoc.py | 2 +-
scripts/qapi/introspect.py | 4 ++--
scripts/qapi/schema.py | 8 ++--
scripts/qapi/types.py | 4
This is for the sake of the new rST generator (the "transmogrifier") so
we can advance multiple lines on occasion while keeping the
generated<-->source mappings accurate.
next_line now simply takes an optional n parameter which chooses the
number of lines to advance.
Signed-o
On Tue, Apr 23, 2024, 3:48 AM Markus Armbruster wrote:
> John Snow writes:
>
> > On Mon, Apr 22, 2024 at 12:38 PM John Snow wrote:
> >>
> >> On Mon, Apr 22, 2024 at 5:20 AM Markus Armbruster
> wrote:
> >> >
> >> > John Snow writ
On Mon, Apr 22, 2024 at 12:38 PM John Snow wrote:
>
> On Mon, Apr 22, 2024 at 5:20 AM Markus Armbruster wrote:
> >
> > John Snow writes:
> >
> > > On Fri, Apr 19, 2024, 10:45 AM Markus Armbruster
> > > wrote:
> > >
> > >> John S
On Mon, Apr 22, 2024 at 5:20 AM Markus Armbruster wrote:
>
> John Snow writes:
>
> > On Fri, Apr 19, 2024, 10:45 AM Markus Armbruster wrote:
> >
> >> John Snow writes:
> >>
> >> > This series adds a new qapi-domain extension for Sphi
On Fri, Apr 19, 2024 at 12:38 AM John Snow wrote:
>
> This commit, finally, adds cross-referencing support to various field
> lists; modeled tightly after Sphinx's own Python domain code.
>
> Cross-referencing support is added to type names provided to :arg:,
> :memb:, :re
On Fri, Apr 19, 2024, 10:45 AM Markus Armbruster wrote:
> John Snow writes:
>
> > This series adds a new qapi-domain extension for Sphinx, which adds a
> > series of custom directives for documenting QAPI definitions.
> >
> > GitLab CI: https://gitlab.com/jsn
This patch demonstrates what happens when you mess up a field list
entry. The next patch adds a safeguard against this.
Signed-off-by: John Snow
---
docs/qapi/index.rst | 4
1 file changed, 4 insertions(+)
diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst
index c68e2044890
it as a regular field
list and doesn't apply the special Grouping postprocessing to it.)
Signed-off-by: John Snow
---
docs/qapi/index.rst| 4
docs/sphinx/qapi-domain.py | 6 ++
2 files changed, 10 insertions(+)
diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst
index a570c37abb2
nes!"
Signed-off-by: Harmonie Snow
Signed-off-by: John Snow
---
docs/qapi/index.rst| 1 +
docs/sphinx-static/theme_overrides.css | 13 +
docs/sphinx/qapi-domain.py | 37 --
3 files changed, 49 insertions(+), 2 deletions(
type
names, but will exclude commands, events, and modules from
consideration.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 14 ++
docs/sphinx/qapi-domain.py | 24
2 files changed, 38 insertions(+)
diff --git a/docs/qapi/index.rst b/docs/qapi/index
ation is superfluous for user documentation. Room for future
improvement, but not now.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 7 +++
docs/sphinx/qapi-domain.py | 19 +++
2 files changed, 26 insertions(+)
diff --git a/docs/qapi/index.rst b/docs/qapi/index.r
Add a little special markup for registering "Since:" information. Adding
it as an option instead of generic content lets us hoist the information
into the Signature bar, optionally put it in the index, etc.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 1 +
docs/s
al, so we're
a bit hosed either way. Do the simpler thing.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 34
docs/sphinx/qapi-domain.py | 110 +++--
2 files changed, 138 insertions(+), 6 deletions(-)
diff --git a/docs/qapi/index.rst b/doc
Use the QAPI object registry to generate a special index just for QAPI
definitions. The index can show entries both by definition type and
alphabetically.
The index can be linked from anywhere in the QEMU manual by using
`qapi-index`.
Signed-off-by: John Snow
---
docs/qapi/index.rst
, this commit also adds a test document that
demonstrates the functionality-so-far to allow reviewers to easily test
and experiment with each commit. The eventual submission for inclusion
will remove this playground file.)
Signed-off-by: John Snow
---
docs/index.rst | 1 +
docs/qapi
Sphinx's own parsing a no-op. Then, in transform_content (which occurs
after Sphinx's nested parse), we simply swap our own parsed content tree
back in for Sphinx's.
It appears a little tricky, but it's the nicest solution I can find.
Signed-off-by: John Snow
---
docs/sphinx/qapi-domain.py | 22
.)
I'm open to suggestions, but wrestling with Sphinx, html and css is time
consuming (for me, at least), so ultimately, I'm afraid I must say:
***PATCHES WELCOME***.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 37 ++
docs/sphinx/qapi-domain.py | 98 +
;)
Signed-off-by: Harmonie Snow
Signed-off-by: John Snow
---
docs/qapi/index.rst| 4
docs/sphinx-static/theme_overrides.css | 25 +
docs/sphinx/qapi-domain.py | 24
3 files changed, 53 insertions(+)
diff
th a pragma.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 34 ++
docs/sphinx/qapi-domain.py | 132 -
2 files changed, 165 insertions(+), 1 deletion(-)
diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst
index e2223d5f363..5516f762a24 10
at for now.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 16
docs/sphinx/qapi-domain.py | 9 +
2 files changed, 25 insertions(+)
diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst
index d81bccfb06a..b07e6e9e2e3 100644
--- a/docs/qapi/index.rst
+++ b
or example blocks in this
sample demo.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 40 ++
docs/sphinx/qapi-domain.py | 25
2 files changed, 65 insertions(+)
diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst
index 9
t attached to a definition contains the
"unstable" entry.)
RFC: Same comments as last patch.
Signed-off-by: Harmonie Snow
Signed-off-by: John Snow
---
docs/qapi/index.rst| 4 +++-
docs/sphinx-static/theme_overrides.css | 6 +-
docs/sphinx/qapi-domain.py |
-member features as deemed
appropriate. It's essentially free-form text.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 6 ++
docs/sphinx/qapi-domain.py | 11 ++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst
index
s possible it's extraneous. It
may possibly be worth keeping just to keep feature parity with Sphinx's
other domains; e.g. "principle of least surprise". Dunno.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 4 +++
docs/sphinx/qapi-domain.py | 67 +++
From: Harmonie Snow
Improve the general look and feel of generated QAPI docs.
Attempt to limit line lengths to offer a more comfortable measure on
maximized windows, and improve some margin and spacing for field lists.
Signed-off-by: Harmonie Snow
Signed-off-by: John Snow
---
docs/sphinx
Cleanup of the last patch to fix the build before closing out this RFC
series.
Signed-off-by: John Snow
---
docs/qapi/index.rst | 4
1 file changed, 4 deletions(-)
diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst
index ef58dfc4bcd..8352a27d4a5 100644
--- a/docs/qapi/index.rst
+++ b
It doesn't really do anything yet, we'll get to it brick-by-brick in the
forthcoming commits to keep the series breezy and the git history
informative.
Signed-off-by: John Snow
---
docs/conf.py | 3 ++-
docs/sphinx/qapi-domain.py | 50 ++
2
r checking in action. The next commit drops the erroneous
fields.
Signed-off-by: John Snow
---
docs/conf.py | 12
docs/qapi/index.rst| 27 +
docs/sphinx/qapi-domain.py | 59 ++
3 files changed, 98 insertions(+)
diff
t what you want.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 15 +++
docs/sphinx/qapi-domain.py | 14 --
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/docs/qapi/index.rst b/docs/qapi/index.rst
index 33b9349a3ee..197587bbc81 100644
--- a
Just to have a bit more to look at in the generated doc, here's a fairly
complex command with a lot of bells and whistles.
Signed-off-by: John Snow
---
docs/qapi/index.rst | 67 +
1 file changed, 67 insertions(+)
diff --git a/docs/qapi/index.rst b
is adapted directly from sphinx.domains.python;
it is unclear to me if there ever would be a collision on merge, hence
the assertion. I haven't been able to trigger it or find better code to
use as a template, so probably I'll just leave the assertion in there.
Signed-off-by: John Snow
---
docs
Hope you like it!
--js
Harmonie Snow (1):
docs/qapi-domain: add CSS styling
John Snow (26):
docs/sphinx: create QAPI domain extension stub
docs/qapi-domain: add qapi:module directive
docs/qapi-module: add QAPI domain object registry
docs/qapi-domain: add QAPI index
docs/qapi-domain: add re
in this series.)
Once again, this code is based very heavily on sphinx.domains.python.
Signed-off-by: John Snow
---
docs/qapi/index.rst| 7 +++
docs/sphinx/qapi-domain.py | 95 +-
2 files changed, 101 insertions(+), 1 deletion(-)
diff --git a/docs/qapi
both the imperative and
indicative forms (:return: and :returns:) to allow doc writers to use
whichever mood "feels right" in the source document. The rendered output
will always use the "Returns:" label, however.
I'm sure you'll let me know how you feel about that. O:-)
Signed-off-b
>
> The command name violates QAPI naming rules: it should be
> query-migration-threads. Too late to fix.
>
> Reported-by: John Snow
> Fixes: 671326201dac (migration: Introduce interface query-migrationthreads)
> Signed-off-by: Markus Armbruster
>
Reviewed-by: John Snow
-
On Fri, Mar 22, 2024, 10:09 AM Markus Armbruster wrote:
> Reported-by: John Snow
> Fixes: 119ebac1feb2 (qapi-schema: use generated marshaller for
> 'qmp_capabilities')
> Signed-off-by: Markus Armbruster
>
Reviewed-by: John Snow
---
> qapi/control.json | 2 --
> 1 file
On Tue, Mar 19, 2024, 12:02 PM Markus Armbruster wrote:
> John Snow writes:
>
> > On Fri, Mar 15, 2024, 11:23 AM Markus Armbruster
> wrote:
> >
> >> Entities with names starting with q_obj_ are implicit object types.
> >> Therefore, QAPISchema._make_
urn typ
> +typ = self.lookup_entity(name)
> +if isinstance(typ, QAPISchemaType):
> +return typ
> + return None
>
> def resolve_type(
> self,
> --
> 2.44.0
>
Sure, dealer's choice.
with your commit message fixup:
Reviewed-by: John Snow
>
Seems obviously fine, though I don't suppose this narrowing will be
"remembered" by the type system. Do we care?
Reviewed-by: John Snow
>
pe to work queue if new
> if typ not in self._used_types:
> self._used_types.append(typ)
> --
> 2.44.0
>
Yeah, if you like this more, go ahead. I know it works because I did it
this way at one point!
Matter of taste and preference etc.
Reviewed-by: John Snow
>
On Fri, Mar 15, 2024, 10:03 AM Markus Armbruster wrote:
> John Snow writes:
>
> > This patch only adds type hints, which aren't utilized at runtime and
> > don't change the behavior of this module in any way.
> >
> > In a scant few locations, type hints are removed
On Thu, Mar 14, 2024, 10:43 AM Markus Armbruster wrote:
> John Snow writes:
>
> > This is *v4*, for some definitions of "version" and "four".
>
> Series
> Reviewed-by: Markus Armbruster
>
> I'll replace PATCH 12, not because it's wrong, just bec
On Thu, Mar 14, 2024, 10:04 AM Markus Armbruster wrote:
> John Snow writes:
>
> > On Thu, Mar 14, 2024, 5:12 AM Markus Armbruster
> wrote:
> >
> >> John Snow writes:
> >>
> >> > Include entities don't have names, but we generally expec
On Thu, Mar 14, 2024, 9:58 AM Markus Armbruster wrote:
> John Snow writes:
>
> > On Thu, Mar 14, 2024, 9:01 AM Markus Armbruster
> wrote:
> >
> >> John Snow writes:
> >>
> >> > Declare, but don't initialize the "members
On Thu, Mar 14, 2024, 9:01 AM Markus Armbruster wrote:
> John Snow writes:
>
> > Declare, but don't initialize the "members" field with type
> > List[QAPISchemaObjectTypeMember].
> >
> > This simplifies the typing from what would otherwise b
On Thu, Mar 14, 2024, 5:12 AM Markus Armbruster wrote:
> John Snow writes:
>
> > Include entities don't have names, but we generally expect "entities" to
> > have names. Reclassify all entities with names as *definitions*, leaving
> > the nameless include enti
On Wed, Mar 13, 2024, 2:57 AM Markus Armbruster wrote:
> John Snow writes:
>
> > On Tue, Feb 20, 2024 at 10:03 AM Markus Armbruster
> wrote:
> >>
> >> John Snow writes:
> >>
> >> > Declare, but don't initialize the "memb
ers expect for properties of an "entity".
Suggested-by: Markus Armbruster
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 144 +++--
1 file changed, 82 insertions(+), 62 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.
"Optional[QAPISchemaObjectType]") [assignment]
qapi/schema.py:893: error: Incompatible types in assignment (expression
has type "QAPISchemaType", variable has type
"Optional[QAPISchemaObjectType]") [assignment]
A simple change to use a temporary variable helps the med
need string quotes are
changed.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 568 -
1 file changed, 396 insertions(+), 172 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 3b8c2ebbb5f..d2faaea6eac 100644
--- a/scripts
SchemaType = ret
which can be replaced with the simpler:
typ = resolve_type("foo")
Signed-off-by: John Snow
---
scripts/qapi/introspect.py | 4 ++--
scripts/qapi/schema.py | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/scripts/qapi/introspect.py b/script
l to check()) in order to simplify the static typing
of that field; avoiding the need of assertions littered at many
callsites to eliminate the possibility of the None value.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sc
Suggested-by: Markus Armbruster
Signed-off-by: John Snow
---
scripts/qapi/pylintrc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc
index 90546df5345..1342412c3cf 100644
--- a/scripts/qapi/pylintrc
+++ b/scripts/qapi
-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 8440a7243d8..c549a4e3bd0 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -381,7 +381,7 @@ def __init__(self, name
This patch can be rolled in with the previous one once the series is
ready for merge, but for work-in-progress' sake, it's separate here.
Signed-off-by: John Snow
---
scripts/qapi/mypy.ini | 5 -
1 file changed, 5 deletions(-)
diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini
the hump, to enable adding type
hints in a forthcoming commit.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 22e065fc13d..d514b3c28f6 100644
--- a/scripts/qapi/schema.py
+++ b/scripts
Optional[str]. mypy does not know that 'info', when it is a
QAPISourceInfo object, cannot ever be false.)
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 58ec3a7c41c
s enforced at runtime
in QAPISchemaVariants.check(). This relationship is not embedded in the
type system though, so QAPISchemaVariants.check_clash() needs to
re-assert this property in order to call
QAPISchemaVariant.type.check_clash().
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 5 +++
Shhh!
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index fed88e9074d..ec4ebef4e33 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -607,6 +607,7 @@ class QAPIDoc
With strict typing enabled, these runtime statements aren't necessary
anymore; we can prove them statically.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 25 -
1 file changed, 25 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index
This function is a bit hard to type as-is; mypy needs some assertions to
assist with the type narrowing.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index eeecdda1b58
These methods should always return a str, it's only the default abstract
implementation that doesn't. They can be marked "abstract", which
requires subclasses to override the method with the proper return type.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 5 -
1 file
strictness
improvements later.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index ec4ebef4e33..2f3c704fa24 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -
pty object as an example. For this reason, we cannot use the empty
list as a replacement test for full initialization and instead rely on
the _checked/_check_complete fields.)
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git
the typing in quite a few places and avoids
needing to assert that the "tag_member is not None" at a dozen
callsites, which can be confusing and suggest the wrong thing to a
drive-by contributor.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 22 +++-
api/parser: demote QAPIExpression to Dict[str, Any]'
017/19:[0042] [FC] 'qapi/schema: add type hints'
Mostly contextual changes.
018/19:[] [--] 'qapi/schema: turn on mypy strictness'
019/19:[0006] [FC] 'qapi/schema: remove unnecessary asserts'
Zapped a few more.
John Snow (23):
qapi/
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 2f3c704fa24..7b13a583ac1 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -707,6 +707,7 @@ def append_line(self, line
tually use a None value in practice, currently.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index b157a3b2bd8..f5c7789d98f 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -99
Small copy-pasto. The correct info field to use in this conditional
block is self.errors.info.
Fixes: 3a025d3d1ffa
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index
1 - 100 of 10685 matches
Mail list logo