From 1d8bda128d2ff1f7e589c90d0ac468b95d260757 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 15 Mar 2017 13:57:06 +0100 Subject: qapi: The #optional tag is redundant, drop We traditionally mark optional members #optional in the doc comment. Before commit 3313b61, this was entirely manual. Commit 3313b61 added some automation because its qapi2texi.py relied on #optional to determine whether a member is optional. This is no longer the case since the previous commit: the only thing qapi2texi.py still does with #optional is stripping it out. We still reject bogus qapi-schema.json and six places for qga/qapi-schema.json. Thus, you can't actually rely on #optional to see whether something is optional. Yet we still make people add it manually. That's just busy-work. Drop the code to check, fix up and strip out #optional, along with all instances of #optional. To keep it out, add code to reject it, to be dropped again once the dust settles. No change to generated documentation. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-18-git-send-email-armbru@redhat.com> --- tests/qapi-schema/doc-optional.err | 1 - tests/qapi-schema/doc-optional.exit | 1 - tests/qapi-schema/doc-optional.json | 7 ------- tests/qapi-schema/doc-optional.out | 0 4 files changed, 9 deletions(-) delete mode 100644 tests/qapi-schema/doc-optional.err delete mode 100644 tests/qapi-schema/doc-optional.exit delete mode 100644 tests/qapi-schema/doc-optional.json delete mode 100644 tests/qapi-schema/doc-optional.out (limited to 'tests/qapi-schema') diff --git a/tests/qapi-schema/doc-optional.err b/tests/qapi-schema/doc-optional.err deleted file mode 100644 index 20d405af79..0000000000 --- a/tests/qapi-schema/doc-optional.err +++ /dev/null @@ -1 +0,0 @@ -tests/qapi-schema/doc-optional.json:3: Description has #optional, but the declaration doesn't diff --git a/tests/qapi-schema/doc-optional.exit b/tests/qapi-schema/doc-optional.exit deleted file mode 100644 index d00491fd7e..0000000000 --- a/tests/qapi-schema/doc-optional.exit +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/tests/qapi-schema/doc-optional.json b/tests/qapi-schema/doc-optional.json deleted file mode 100644 index 06c855ec94..0000000000 --- a/tests/qapi-schema/doc-optional.json +++ /dev/null @@ -1,7 +0,0 @@ -# Description #optional should match declaration - -## -# @foo: -# @a: a #optional -## -{ 'command': 'foo', 'data': {'a': 'int'} } diff --git a/tests/qapi-schema/doc-optional.out b/tests/qapi-schema/doc-optional.out deleted file mode 100644 index e69de29bb2..0000000000 -- cgit v1.2.3-55-g7522