From 7be6c511943613c60b3e5b640e09bdc916be3b65 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 27 Sep 2019 15:46:17 +0200 Subject: qapi: Prefix frontend errors with an "in definition" line We take pains to include the offending expression in error messages, e.g. tests/qapi-schema/alternate-any.json:2: alternate 'Alt' member 'one' cannot use type 'any' But not always: tests/qapi-schema/enum-if-invalid.json:2: 'if' condition must be a string or a list of strings Instead of improving them one by one, report the offending expression whenever it is known, like this: tests/qapi-schema/enum-if-invalid.json: In enum 'TestIfEnum': tests/qapi-schema/enum-if-invalid.json:2: 'if' condition must be a string or a list of strings Error messages that mention the offending expression become a bit redundant, e.g. tests/qapi-schema/alternate-any.json: In alternate 'Alt': tests/qapi-schema/alternate-any.json:2: alternate 'Alt' member 'one' cannot use type 'any' I'll take care of that later in this series. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20190927134639.4284-5-armbru@redhat.com> --- tests/qapi-schema/args-array-unknown.err | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/qapi-schema/args-array-unknown.err') diff --git a/tests/qapi-schema/args-array-unknown.err b/tests/qapi-schema/args-array-unknown.err index cd7a0f98d7..c88a5612b2 100644 --- a/tests/qapi-schema/args-array-unknown.err +++ b/tests/qapi-schema/args-array-unknown.err @@ -1 +1,2 @@ +tests/qapi-schema/args-array-unknown.json: In command 'oops': tests/qapi-schema/args-array-unknown.json:2: Member 'array' of 'data' for command 'oops' uses unknown type 'NoSuchType' -- cgit v1.2.3-55-g7522 From 2ab218aad6e2ddf4e95a7d583492ad7142927ca5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 27 Sep 2019 15:46:19 +0200 Subject: qapi: Change frontend error messages to start with lower case Starting error messages with a capital letter complicates things when text can get interpolated both at the beginning and in the middle of an error message. The next patch will do that. Switch to lower case to keep it simpler. For what it's worth, the GNU Coding Standards advise the message "should not begin with a capital letter when it follows a program name and/or file name, because that isn’t the beginning of a sentence. (The sentence conceptually starts at the beginning of the line.)" While there, avoid breaking lines containing multiple arguments in the middle of an argument. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20190927134639.4284-7-armbru@redhat.com> --- scripts/qapi/common.py | 192 +++++++++++---------- tests/qapi-schema/alternate-any.err | 2 +- tests/qapi-schema/alternate-array.err | 2 +- tests/qapi-schema/alternate-base.err | 2 +- .../qapi-schema/alternate-conflict-bool-string.err | 2 +- tests/qapi-schema/alternate-conflict-dict.err | 2 +- tests/qapi-schema/alternate-conflict-enum-bool.err | 2 +- tests/qapi-schema/alternate-conflict-enum-int.err | 2 +- .../qapi-schema/alternate-conflict-num-string.err | 2 +- tests/qapi-schema/alternate-conflict-string.err | 2 +- tests/qapi-schema/alternate-empty.err | 2 +- tests/qapi-schema/alternate-invalid-dict.err | 2 +- tests/qapi-schema/alternate-nested.err | 2 +- tests/qapi-schema/alternate-unknown.err | 2 +- tests/qapi-schema/args-array-empty.err | 2 +- tests/qapi-schema/args-array-unknown.err | 2 +- tests/qapi-schema/args-member-array-bad.err | 2 +- tests/qapi-schema/args-member-case.err | 2 +- tests/qapi-schema/args-member-unknown.err | 2 +- tests/qapi-schema/bad-type-int.err | 2 +- tests/qapi-schema/base-cycle-direct.err | 2 +- tests/qapi-schema/base-cycle-indirect.err | 2 +- tests/qapi-schema/doc-bad-alternate-member.err | 2 +- tests/qapi-schema/doc-bad-command-arg.err | 2 +- tests/qapi-schema/doc-bad-symbol.err | 2 +- tests/qapi-schema/doc-bad-union-member.err | 2 +- tests/qapi-schema/doc-before-include.err | 2 +- tests/qapi-schema/doc-before-pragma.err | 2 +- tests/qapi-schema/doc-duplicated-return.err | 2 +- tests/qapi-schema/doc-duplicated-since.err | 2 +- tests/qapi-schema/doc-empty-arg.err | 2 +- tests/qapi-schema/doc-empty-section.err | 2 +- tests/qapi-schema/doc-empty-symbol.err | 2 +- tests/qapi-schema/doc-invalid-end.err | 2 +- tests/qapi-schema/doc-invalid-end2.err | 2 +- tests/qapi-schema/doc-invalid-start.err | 2 +- tests/qapi-schema/doc-missing-colon.err | 2 +- tests/qapi-schema/doc-missing-expr.err | 2 +- tests/qapi-schema/doc-missing-space.err | 2 +- tests/qapi-schema/doc-missing.err | 2 +- tests/qapi-schema/doc-no-symbol.err | 2 +- tests/qapi-schema/double-type.err | 2 +- tests/qapi-schema/duplicate-key.err | 2 +- tests/qapi-schema/enum-bad-member.err | 2 +- tests/qapi-schema/enum-bad-name.err | 2 +- tests/qapi-schema/enum-bad-prefix.err | 2 +- tests/qapi-schema/enum-dict-member-unknown.err | 2 +- tests/qapi-schema/enum-int-member.err | 2 +- tests/qapi-schema/enum-member-case.err | 2 +- tests/qapi-schema/enum-missing-data.err | 2 +- tests/qapi-schema/enum-wrong-data.err | 2 +- tests/qapi-schema/escape-outside-string.err | 2 +- tests/qapi-schema/event-boxed-empty.err | 2 +- tests/qapi-schema/event-member-invalid-dict.err | 2 +- tests/qapi-schema/event-nest-struct.err | 2 +- tests/qapi-schema/features-bad-type.err | 2 +- tests/qapi-schema/features-missing-name.err | 2 +- tests/qapi-schema/features-name-bad-type.err | 2 +- tests/qapi-schema/features-no-list.err | 2 +- tests/qapi-schema/features-unknown-key.err | 2 +- tests/qapi-schema/flat-union-array-branch.err | 2 +- tests/qapi-schema/flat-union-bad-discriminator.err | 2 +- .../flat-union-discriminator-bad-name.err | 2 +- tests/qapi-schema/flat-union-empty.err | 2 +- .../qapi-schema/flat-union-inline-invalid-dict.err | 2 +- tests/qapi-schema/flat-union-inline.err | 2 +- tests/qapi-schema/flat-union-int-branch.err | 2 +- .../qapi-schema/flat-union-invalid-branch-key.err | 2 +- .../flat-union-invalid-discriminator.err | 2 +- .../flat-union-invalid-if-discriminator.err | 2 +- tests/qapi-schema/flat-union-no-base.err | 2 +- .../flat-union-optional-discriminator.err | 2 +- .../flat-union-string-discriminator.err | 2 +- tests/qapi-schema/funny-char.err | 2 +- tests/qapi-schema/funny-word.err | 2 +- tests/qapi-schema/ident-with-escape.err | 2 +- tests/qapi-schema/include-before-err.err | 2 +- tests/qapi-schema/include-cycle.err | 2 +- tests/qapi-schema/include-extra-junk.err | 2 +- tests/qapi-schema/include-nested-err.err | 2 +- tests/qapi-schema/include-non-file.err | 2 +- tests/qapi-schema/include-self-cycle.err | 2 +- tests/qapi-schema/leading-comma-list.err | 2 +- tests/qapi-schema/leading-comma-object.err | 2 +- tests/qapi-schema/missing-colon.err | 2 +- tests/qapi-schema/missing-comma-list.err | 2 +- tests/qapi-schema/missing-comma-object.err | 2 +- tests/qapi-schema/missing-type.err | 2 +- .../nested-struct-data-invalid-dict.err | 2 +- tests/qapi-schema/nested-struct-data.err | 2 +- tests/qapi-schema/non-objects.err | 2 +- tests/qapi-schema/pragma-doc-required-crap.err | 2 +- tests/qapi-schema/pragma-extra-junk.err | 2 +- .../pragma-name-case-whitelist-crap.err | 2 +- tests/qapi-schema/pragma-non-dict.err | 2 +- .../qapi-schema/pragma-returns-whitelist-crap.err | 2 +- tests/qapi-schema/pragma-unknown.err | 2 +- tests/qapi-schema/quoted-structural-chars.err | 2 +- tests/qapi-schema/reserved-enum-q.err | 2 +- tests/qapi-schema/reserved-member-has.err | 2 +- tests/qapi-schema/reserved-member-q.err | 2 +- tests/qapi-schema/reserved-member-u.err | 2 +- tests/qapi-schema/reserved-member-underscore.err | 2 +- tests/qapi-schema/string-code-point-127.err | 2 +- tests/qapi-schema/string-code-point-31.err | 2 +- tests/qapi-schema/struct-member-invalid-dict.err | 2 +- tests/qapi-schema/struct-member-invalid.err | 2 +- tests/qapi-schema/trailing-comma-list.err | 2 +- tests/qapi-schema/trailing-comma-object.err | 2 +- tests/qapi-schema/unclosed-list.err | 2 +- tests/qapi-schema/unclosed-object.err | 2 +- tests/qapi-schema/unclosed-string.err | 2 +- tests/qapi-schema/union-base-empty.err | 2 +- tests/qapi-schema/union-base-no-discriminator.err | 2 +- tests/qapi-schema/union-branch-case.err | 2 +- tests/qapi-schema/union-branch-invalid-dict.err | 2 +- tests/qapi-schema/union-empty.err | 2 +- tests/qapi-schema/union-optional-branch.err | 2 +- tests/qapi-schema/union-unknown.err | 2 +- tests/qapi-schema/unknown-escape.err | 2 +- tests/qapi-schema/unknown-expr-key.err | 2 +- 121 files changed, 222 insertions(+), 210 deletions(-) (limited to 'tests/qapi-schema/args-array-unknown.err') diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index ed4bff4479..3d73332487 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -207,7 +207,7 @@ class QAPIDoc(object): return if line[0] != ' ': - raise QAPIParseError(self._parser, "Missing space after #") + raise QAPIParseError(self._parser, "missing space after #") line = line[1:] self._append_line(line) @@ -241,11 +241,11 @@ class QAPIDoc(object): # recognized, and get silently treated as ordinary text if not self.symbol and not self.body.text and line.startswith('@'): if not line.endswith(':'): - raise QAPIParseError(self._parser, "Line should end with ':'") + raise QAPIParseError(self._parser, "line should end with ':'") self.symbol = line[1:-1] # FIXME invalid names other than the empty string aren't flagged if not self.symbol: - raise QAPIParseError(self._parser, "Invalid name") + raise QAPIParseError(self._parser, "invalid name") elif self.symbol: # This is a definition documentation block if name.startswith('@') and name.endswith(':'): @@ -344,7 +344,7 @@ class QAPIDoc(object): def _start_symbol_section(self, symbols_dict, name): # FIXME invalid names other than the empty string aren't flagged if not name: - raise QAPIParseError(self._parser, "Invalid parameter name") + raise QAPIParseError(self._parser, "invalid parameter name") if name in symbols_dict: raise QAPIParseError(self._parser, "'%s' parameter name duplicated" % name) @@ -362,7 +362,7 @@ class QAPIDoc(object): def _start_section(self, name=None): if name in ('Returns', 'Since') and self.has_section(name): raise QAPIParseError(self._parser, - "Duplicated '%s' section" % name) + "duplicated '%s' section" % name) self._end_section() self._section = QAPIDoc.Section(name) self.sections.append(self._section) @@ -371,8 +371,9 @@ class QAPIDoc(object): if self._section: text = self._section.text = self._section.text.strip() if self._section.name and (not text or text.isspace()): - raise QAPIParseError(self._parser, "Empty doc section '%s'" - % self._section.name) + raise QAPIParseError( + self._parser, + "empty doc section '%s'" % self._section.name) self._section = None def _append_freeform(self, line): @@ -400,7 +401,7 @@ class QAPIDoc(object): if bogus: raise QAPISemError( self.info, - "The following documented members are not in " + "the following documented members are not in " "the declaration: %s" % ", ".join(bogus)) @@ -432,11 +433,11 @@ class QAPISchemaParser(object): if 'include' in expr: self.reject_expr_doc(cur_doc) if len(expr) != 1: - raise QAPISemError(info, "Invalid 'include' directive") + raise QAPISemError(info, "invalid 'include' directive") include = expr['include'] if not isinstance(include, str): raise QAPISemError(info, - "Value of 'include' must be a string") + "value of 'include' must be a string") incl_fname = os.path.join(os.path.dirname(self.fname), include) self.exprs.append({'expr': {'include': incl_fname}, @@ -449,11 +450,11 @@ class QAPISchemaParser(object): elif "pragma" in expr: self.reject_expr_doc(cur_doc) if len(expr) != 1: - raise QAPISemError(info, "Invalid 'pragma' directive") + raise QAPISemError(info, "invalid 'pragma' directive") pragma = expr['pragma'] if not isinstance(pragma, dict): raise QAPISemError( - info, "Value of 'pragma' must be an object") + info, "value of 'pragma' must be an object") for name, value in pragma.items(): self._pragma(name, value, info) else: @@ -462,7 +463,7 @@ class QAPISchemaParser(object): if cur_doc: if not cur_doc.symbol: raise QAPISemError( - cur_doc.info, "Definition documentation required") + cur_doc.info, "definition documentation required") expr_elem['doc'] = cur_doc self.exprs.append(expr_elem) cur_doc = None @@ -473,7 +474,7 @@ class QAPISchemaParser(object): if doc and doc.symbol: raise QAPISemError( doc.info, - "Documentation for '%s' is not followed by the definition" + "documentation for '%s' is not followed by the definition" % doc.symbol) def _include(self, include, info, incl_fname, previously_included): @@ -482,7 +483,7 @@ class QAPISchemaParser(object): inf = info while inf: if incl_abs_fname == os.path.abspath(inf.fname): - raise QAPISemError(info, "Inclusion loop for %s" % include) + raise QAPISemError(info, "inclusion loop for %s" % include) inf = inf.parent # skip multiple include of the same file @@ -503,24 +504,24 @@ class QAPISchemaParser(object): if name == 'doc-required': if not isinstance(value, bool): raise QAPISemError(info, - "Pragma 'doc-required' must be boolean") + "pragma 'doc-required' must be boolean") doc_required = value elif name == 'returns-whitelist': if (not isinstance(value, list) or any([not isinstance(elt, str) for elt in value])): - raise QAPISemError(info, - "Pragma returns-whitelist must be" - " a list of strings") + raise QAPISemError( + info, + "pragma returns-whitelist must be a list of strings") returns_whitelist = value elif name == 'name-case-whitelist': if (not isinstance(value, list) or any([not isinstance(elt, str) for elt in value])): - raise QAPISemError(info, - "Pragma name-case-whitelist must be" - " a list of strings") + raise QAPISemError( + info, + "pragma name-case-whitelist must be a list of strings") name_case_whitelist = value else: - raise QAPISemError(info, "Unknown pragma '%s'" % name) + raise QAPISemError(info, "unknown pragma '%s'" % name) def accept(self, skip_comment=True): while True: @@ -547,13 +548,13 @@ class QAPISchemaParser(object): ch = self.src[self.cursor] self.cursor += 1 if ch == '\n': - raise QAPIParseError(self, "Missing terminating \"'\"") + raise QAPIParseError(self, "missing terminating \"'\"") if esc: # Note: we recognize only \\ because we have # no use for funny characters in strings if ch != '\\': raise QAPIParseError(self, - "Unknown escape \\%s" % ch) + "unknown escape \\%s" % ch) esc = False elif ch == '\\': esc = True @@ -563,7 +564,7 @@ class QAPISchemaParser(object): return if ord(ch) < 32 or ord(ch) >= 127: raise QAPIParseError( - self, "Funny character in string") + self, "funny character in string") string += ch elif self.src.startswith('true', self.pos): self.val = True @@ -584,7 +585,7 @@ class QAPISchemaParser(object): # character match = re.match('[^[\\]{}:,\\s\'"]+', self.src[self.cursor-1:]) - raise QAPIParseError(self, "Stray '%s'" % match.group(0)) + raise QAPIParseError(self, "stray '%s'" % match.group(0)) def get_members(self): expr = OrderedDict() @@ -592,24 +593,24 @@ class QAPISchemaParser(object): self.accept() return expr if self.tok != "'": - raise QAPIParseError(self, "Expected string or '}'") + raise QAPIParseError(self, "expected string or '}'") while True: key = self.val self.accept() if self.tok != ':': - raise QAPIParseError(self, "Expected ':'") + raise QAPIParseError(self, "expected ':'") self.accept() if key in expr: - raise QAPIParseError(self, "Duplicate key '%s'" % key) + raise QAPIParseError(self, "duplicate key '%s'" % key) expr[key] = self.get_expr(True) if self.tok == '}': self.accept() return expr if self.tok != ',': - raise QAPIParseError(self, "Expected ',' or '}'") + raise QAPIParseError(self, "expected ',' or '}'") self.accept() if self.tok != "'": - raise QAPIParseError(self, "Expected string") + raise QAPIParseError(self, "expected string") def get_values(self): expr = [] @@ -618,19 +619,19 @@ class QAPISchemaParser(object): return expr if self.tok not in "{['tfn": raise QAPIParseError( - self, "Expected '{', '[', ']', string, boolean or 'null'") + self, "expected '{', '[', ']', string, boolean or 'null'") while True: expr.append(self.get_expr(True)) if self.tok == ']': self.accept() return expr if self.tok != ',': - raise QAPIParseError(self, "Expected ',' or ']'") + raise QAPIParseError(self, "expected ',' or ']'") self.accept() def get_expr(self, nested): if self.tok != '{' and not nested: - raise QAPIParseError(self, "Expected '{'") + raise QAPIParseError(self, "expected '{'") if self.tok == '{': self.accept() expr = self.get_members() @@ -642,13 +643,13 @@ class QAPISchemaParser(object): self.accept() else: raise QAPIParseError( - self, "Expected '{', '[', string, boolean or 'null'") + self, "expected '{', '[', string, boolean or 'null'") return expr def get_doc(self, info): if self.val != '##': - raise QAPIParseError(self, "Junk after '##' at start of " - "documentation comment") + raise QAPIParseError( + self, "junk after '##' at start of documentation comment") doc = QAPIDoc(self, info) self.accept(False) @@ -656,8 +657,9 @@ class QAPISchemaParser(object): if self.val.startswith('##'): # End of doc comment if self.val != '##': - raise QAPIParseError(self, "Junk after '##' at end of " - "documentation comment") + raise QAPIParseError( + self, + "junk after '##' at end of documentation comment") doc.end_comment() self.accept() return doc @@ -665,7 +667,7 @@ class QAPISchemaParser(object): doc.append(self.val) self.accept(False) - raise QAPIParseError(self, "Documentation comment must end with '##'") + raise QAPIParseError(self, "documentation comment must end with '##'") # @@ -804,18 +806,18 @@ def check_type(info, source, value, # value is a dictionary, check that each member is okay for (key, arg) in value.items(): - check_name(info, "Member of %s" % source, key, + check_name(info, "member of %s" % source, key, allow_optional=True, permit_upper=permit_upper) if c_name(key, False) == 'u' or c_name(key, False).startswith('has_'): - raise QAPISemError(info, "Member of %s uses reserved name '%s'" - % (source, key)) + raise QAPISemError( + info, "member of %s uses reserved name '%s'" % (source, key)) # Todo: allow dictionaries to represent default values of # an optional argument. check_known_keys(info, "member '%s' of %s" % (key, source), arg, ['type'], ['if']) check_if(arg, info) normalize_if(arg) - check_type(info, "Member '%s' of %s" % (key, source), + check_type(info, "member '%s' of %s" % (key, source), arg['type'], allow_array=True, allow_metas=['built-in', 'union', 'alternate', 'struct', 'enum']) @@ -868,8 +870,8 @@ def check_union(expr, info): enum_values = members.keys() allow_metas = ['built-in', 'union', 'alternate', 'struct', 'enum'] if base is not None: - raise QAPISemError(info, "Simple union '%s' must not have a base" % - name) + raise QAPISemError( + info, "simple union '%s' must not have a base" % name) # Else, it's a flat union. else: @@ -878,46 +880,47 @@ def check_union(expr, info): base, allow_dict=name, allow_metas=['struct']) if not base: - raise QAPISemError(info, "Flat union '%s' must have a base" - % name) + raise QAPISemError( + info, "flat union '%s' must have a base" % name) base_members = find_base_members(base) assert base_members is not None # The value of member 'discriminator' must name a non-optional # member of the base struct. - check_name(info, "Discriminator of flat union '%s'" % name, + check_name(info, "discriminator of flat union '%s'" % name, discriminator) discriminator_value = base_members.get(discriminator) if not discriminator_value: raise QAPISemError(info, - "Discriminator '%s' is not a member of 'base'" + "discriminator '%s' is not a member of 'base'" % discriminator) if discriminator_value.get('if'): raise QAPISemError( info, - "The discriminator '%s' for union %s must not be conditional" + "the discriminator '%s' for union %s must not be conditional" % (discriminator, name)) enum_define = enum_types.get(discriminator_value['type']) # Do not allow string discriminator if not enum_define: - raise QAPISemError(info, - "Discriminator '%s' must be of enumeration " - "type" % discriminator) + raise QAPISemError( + info, + "discriminator '%s' must be of enumeration type" + % discriminator) enum_values = enum_get_names(enum_define) allow_metas = ['struct'] if (len(enum_values) == 0): - raise QAPISemError(info, "Union '%s' has no branches" % name) + raise QAPISemError(info, "union '%s' has no branches" % name) for (key, value) in members.items(): - check_name(info, "Member of union '%s'" % name, key) + check_name(info, "member of union '%s'" % name, key) check_known_keys(info, "member '%s' of union '%s'" % (key, name), value, ['type'], ['if']) check_if(value, info) normalize_if(value) # Each value must name a known type - check_type(info, "Member '%s' of union '%s'" % (key, name), + check_type(info, "member '%s' of union '%s'" % (key, name), value['type'], allow_array=not base, allow_metas=allow_metas) @@ -925,10 +928,10 @@ def check_union(expr, info): # of 'data' must also be members of the enum type. if discriminator is not None: if key not in enum_values: - raise QAPISemError(info, - "Discriminator value '%s' is not found in " - "enum '%s'" - % (key, enum_define['enum'])) + raise QAPISemError( + info, + "discriminator value '%s' is not found in enum '%s'" + % (key, enum_define['enum'])) def check_alternate(expr, info): @@ -938,9 +941,9 @@ def check_alternate(expr, info): if len(members) == 0: raise QAPISemError(info, - "Alternate '%s' cannot have empty 'data'" % name) + "alternate '%s' cannot have empty 'data'" % name) for (key, value) in members.items(): - check_name(info, "Member of alternate '%s'" % name, key) + check_name(info, "member of alternate '%s'" % name, key) check_known_keys(info, "member '%s' of alternate '%s'" % (key, name), value, ['type'], ['if']) @@ -949,12 +952,14 @@ def check_alternate(expr, info): typ = value['type'] # Ensure alternates have no type conflicts. - check_type(info, "Member '%s' of alternate '%s'" % (key, name), typ, + check_type(info, "member '%s' of alternate '%s'" % (key, name), typ, allow_metas=['built-in', 'union', 'struct', 'enum']) qtype = find_alternate_member_qtype(typ) if not qtype: - raise QAPISemError(info, "Alternate '%s' member '%s' cannot use " - "type '%s'" % (name, key, typ)) + raise QAPISemError( + info, + "alternate '%s' member '%s' cannot use type '%s'" + % (name, key, typ)) conflicting = set([qtype]) if qtype == 'QTYPE_QSTRING': enum_expr = enum_types.get(typ) @@ -969,9 +974,11 @@ def check_alternate(expr, info): conflicting.add('QTYPE_QBOOL') for qt in conflicting: if qt in types_seen: - raise QAPISemError(info, "Alternate '%s' member '%s' can't " - "be distinguished from member '%s'" - % (name, key, types_seen[qt])) + raise QAPISemError( + info, + "alternate '%s' member '%s' can't be distinguished " + "from member '%s'" + % (name, key, types_seen[qt])) types_seen[qt] = key @@ -982,10 +989,10 @@ def check_enum(expr, info): if not isinstance(members, list): raise QAPISemError(info, - "Enum '%s' requires an array for 'data'" % name) + "enum '%s' requires an array for 'data'" % name) if prefix is not None and not isinstance(prefix, str): raise QAPISemError(info, - "Enum '%s' requires a string for 'prefix'" % name) + "enum '%s' requires a string for 'prefix'" % name) permit_upper = name in name_case_whitelist @@ -994,7 +1001,7 @@ def check_enum(expr, info): ['name'], ['if']) check_if(member, info) normalize_if(member) - check_name(info, "Member of enum '%s'" % name, member['name'], + check_name(info, "member of enum '%s'" % name, member['name'], enum_member=True, permit_upper=permit_upper) @@ -1010,9 +1017,8 @@ def check_struct(expr, info): if features: if not isinstance(features, list): - raise QAPISemError(info, - "Struct '%s' requires an array for 'features'" % - name) + raise QAPISemError( + info, "struct '%s' requires an array for 'features'" % name) for f in features: assert isinstance(f, dict) check_known_keys(info, "feature of struct %s" % name, f, @@ -1020,7 +1026,7 @@ def check_struct(expr, info): check_if(f, info) normalize_if(f) - check_name(info, "Feature of struct %s" % name, f['name']) + check_name(info, "feature of struct %s" % name, f['name']) def check_known_keys(info, source, value, required, optional): @@ -1030,15 +1036,19 @@ def check_known_keys(info, source, value, required, optional): missing = set(required) - set(value) if missing: - raise QAPISemError(info, "Key%s %s %s missing from %s" - % ('s' if len(missing) > 1 else '', pprint(missing), - 'are' if len(missing) > 1 else 'is', source)) + raise QAPISemError( + info, + "key%s %s %s missing from %s" + % ('s' if len(missing) > 1 else '', pprint(missing), + 'are' if len(missing) > 1 else 'is', source)) allowed = set(required + optional) unknown = set(value) - allowed if unknown: - raise QAPISemError(info, "Unknown key%s %s in %s\nValid keys are %s." - % ('s' if len(unknown) > 1 else '', pprint(unknown), - source, pprint(allowed))) + raise QAPISemError( + info, + "unknown key%s %s in %s\nValid keys are %s." + % ('s' if len(unknown) > 1 else '', pprint(unknown), + source, pprint(allowed))) def check_keys(expr, info, meta, required, optional=[]): @@ -1106,7 +1116,7 @@ def check_exprs(exprs): if not doc and doc_required: raise QAPISemError(info, - "Definition missing documentation comment") + "definition missing documentation comment") if 'enum' in expr: meta = 'enum' @@ -1142,14 +1152,16 @@ def check_exprs(exprs): check_keys(expr, info, 'event', [], ['data', 'boxed', 'if']) normalize_members(expr.get('data')) else: - raise QAPISemError(info, "Expression is missing metatype") + raise QAPISemError(info, "expression is missing metatype") normalize_if(expr) name = expr[meta] add_name(name, info, meta) info.set_defn(meta, name) if doc and doc.symbol != name: - raise QAPISemError(info, "Definition of '%s' follows documentation" - " for '%s'" % (name, doc.symbol)) + raise QAPISemError( + info, + "definition of '%s' follows documentation for '%s'" + % (name, doc.symbol)) # Validate that exprs make sense for expr_elem in exprs: @@ -1462,7 +1474,7 @@ class QAPISchemaObjectType(QAPISchemaType): if self._checked: # Recursed: C struct contains itself raise QAPISemError(self.info, - "Object %s contains itself" % self.name) + "object %s contains itself" % self.name) QAPISchemaType.check(self, schema) assert self._checked and self.members is None @@ -1734,7 +1746,7 @@ class QAPISchemaCommand(QAPISchemaEntity): assert isinstance(self.arg_type, QAPISchemaObjectType) assert not self.arg_type.variants or self.boxed elif self.boxed: - raise QAPISemError(self.info, "Use of 'boxed' requires 'data'") + raise QAPISemError(self.info, "use of 'boxed' requires 'data'") if self._ret_type_name: self.ret_type = schema.lookup_type(self._ret_type_name) assert isinstance(self.ret_type, QAPISchemaType) @@ -1763,7 +1775,7 @@ class QAPISchemaEvent(QAPISchemaEntity): assert isinstance(self.arg_type, QAPISchemaObjectType) assert not self.arg_type.variants or self.boxed elif self.boxed: - raise QAPISemError(self.info, "Use of 'boxed' requires 'data'") + raise QAPISemError(self.info, "use of 'boxed' requires 'data'") def visit(self, visitor): QAPISchemaEntity.visit(self, visitor) diff --git a/tests/qapi-schema/alternate-any.err b/tests/qapi-schema/alternate-any.err index 177a11cc12..5314760775 100644 --- a/tests/qapi-schema/alternate-any.err +++ b/tests/qapi-schema/alternate-any.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-any.json: In alternate 'Alt': -tests/qapi-schema/alternate-any.json:2: Alternate 'Alt' member 'one' cannot use type 'any' +tests/qapi-schema/alternate-any.json:2: alternate 'Alt' member 'one' cannot use type 'any' diff --git a/tests/qapi-schema/alternate-array.err b/tests/qapi-schema/alternate-array.err index f16f266c76..a72e4b274d 100644 --- a/tests/qapi-schema/alternate-array.err +++ b/tests/qapi-schema/alternate-array.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-array.json: In alternate 'Alt': -tests/qapi-schema/alternate-array.json:5: Member 'two' of alternate 'Alt' cannot be an array +tests/qapi-schema/alternate-array.json:5: member 'two' of alternate 'Alt' cannot be an array diff --git a/tests/qapi-schema/alternate-base.err b/tests/qapi-schema/alternate-base.err index ebe05bc898..4c9158db02 100644 --- a/tests/qapi-schema/alternate-base.err +++ b/tests/qapi-schema/alternate-base.err @@ -1,2 +1,2 @@ -tests/qapi-schema/alternate-base.json:4: Unknown key 'base' in alternate 'Alt' +tests/qapi-schema/alternate-base.json:4: unknown key 'base' in alternate 'Alt' Valid keys are 'alternate', 'data', 'if'. diff --git a/tests/qapi-schema/alternate-conflict-bool-string.err b/tests/qapi-schema/alternate-conflict-bool-string.err index edfd36b7ad..e2b89f3cac 100644 --- a/tests/qapi-schema/alternate-conflict-bool-string.err +++ b/tests/qapi-schema/alternate-conflict-bool-string.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-bool-string.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-bool-string.json:2: Alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-bool-string.json:2: alternate 'Alt' member 'two' can't be distinguished from member 'one' diff --git a/tests/qapi-schema/alternate-conflict-dict.err b/tests/qapi-schema/alternate-conflict-dict.err index 61ae93273a..e3f7d9072d 100644 --- a/tests/qapi-schema/alternate-conflict-dict.err +++ b/tests/qapi-schema/alternate-conflict-dict.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-dict.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-dict.json:6: Alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-dict.json:6: alternate 'Alt' member 'two' can't be distinguished from member 'one' diff --git a/tests/qapi-schema/alternate-conflict-enum-bool.err b/tests/qapi-schema/alternate-conflict-enum-bool.err index b006d1efbc..d0fe1433fc 100644 --- a/tests/qapi-schema/alternate-conflict-enum-bool.err +++ b/tests/qapi-schema/alternate-conflict-enum-bool.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-enum-bool.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-enum-bool.json:4: Alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-enum-bool.json:4: alternate 'Alt' member 'two' can't be distinguished from member 'one' diff --git a/tests/qapi-schema/alternate-conflict-enum-int.err b/tests/qapi-schema/alternate-conflict-enum-int.err index 817b5c0191..866428b1d1 100644 --- a/tests/qapi-schema/alternate-conflict-enum-int.err +++ b/tests/qapi-schema/alternate-conflict-enum-int.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-enum-int.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-enum-int.json:4: Alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-enum-int.json:4: alternate 'Alt' member 'two' can't be distinguished from member 'one' diff --git a/tests/qapi-schema/alternate-conflict-num-string.err b/tests/qapi-schema/alternate-conflict-num-string.err index abc188e0a6..d00975453e 100644 --- a/tests/qapi-schema/alternate-conflict-num-string.err +++ b/tests/qapi-schema/alternate-conflict-num-string.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-num-string.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-num-string.json:2: Alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-num-string.json:2: alternate 'Alt' member 'two' can't be distinguished from member 'one' diff --git a/tests/qapi-schema/alternate-conflict-string.err b/tests/qapi-schema/alternate-conflict-string.err index 77ccd80cd7..0231f4fed1 100644 --- a/tests/qapi-schema/alternate-conflict-string.err +++ b/tests/qapi-schema/alternate-conflict-string.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-string.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-string.json:2: Alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-string.json:2: alternate 'Alt' member 'two' can't be distinguished from member 'one' diff --git a/tests/qapi-schema/alternate-empty.err b/tests/qapi-schema/alternate-empty.err index 9daac031e4..db92d70f10 100644 --- a/tests/qapi-schema/alternate-empty.err +++ b/tests/qapi-schema/alternate-empty.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-empty.json: In alternate 'Alt': -tests/qapi-schema/alternate-empty.json:2: Alternate 'Alt' cannot have empty 'data' +tests/qapi-schema/alternate-empty.json:2: alternate 'Alt' cannot have empty 'data' diff --git a/tests/qapi-schema/alternate-invalid-dict.err b/tests/qapi-schema/alternate-invalid-dict.err index 701db8cdce..f85b941750 100644 --- a/tests/qapi-schema/alternate-invalid-dict.err +++ b/tests/qapi-schema/alternate-invalid-dict.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-invalid-dict.json: In alternate 'Alt': -tests/qapi-schema/alternate-invalid-dict.json:2: Key 'type' is missing from member 'two' of alternate 'Alt' +tests/qapi-schema/alternate-invalid-dict.json:2: key 'type' is missing from member 'two' of alternate 'Alt' diff --git a/tests/qapi-schema/alternate-nested.err b/tests/qapi-schema/alternate-nested.err index 4ab5328025..03fb9fb212 100644 --- a/tests/qapi-schema/alternate-nested.err +++ b/tests/qapi-schema/alternate-nested.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-nested.json: In alternate 'Alt2': -tests/qapi-schema/alternate-nested.json:4: Member 'nested' of alternate 'Alt2' cannot use alternate type 'Alt1' +tests/qapi-schema/alternate-nested.json:4: member 'nested' of alternate 'Alt2' cannot use alternate type 'Alt1' diff --git a/tests/qapi-schema/alternate-unknown.err b/tests/qapi-schema/alternate-unknown.err index 5bd473325e..7a533b2b74 100644 --- a/tests/qapi-schema/alternate-unknown.err +++ b/tests/qapi-schema/alternate-unknown.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-unknown.json: In alternate 'Alt': -tests/qapi-schema/alternate-unknown.json:2: Member 'unknown' of alternate 'Alt' uses unknown type 'MissingType' +tests/qapi-schema/alternate-unknown.json:2: member 'unknown' of alternate 'Alt' uses unknown type 'MissingType' diff --git a/tests/qapi-schema/args-array-empty.err b/tests/qapi-schema/args-array-empty.err index fb95f0c4de..fe1480671b 100644 --- a/tests/qapi-schema/args-array-empty.err +++ b/tests/qapi-schema/args-array-empty.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-array-empty.json: In command 'oops': -tests/qapi-schema/args-array-empty.json:2: Member 'empty' of 'data' for command 'oops': array type must contain single type name +tests/qapi-schema/args-array-empty.json:2: member 'empty' of 'data' for command 'oops': array type must contain single type name diff --git a/tests/qapi-schema/args-array-unknown.err b/tests/qapi-schema/args-array-unknown.err index c88a5612b2..57b0d8972e 100644 --- a/tests/qapi-schema/args-array-unknown.err +++ b/tests/qapi-schema/args-array-unknown.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-array-unknown.json: In command 'oops': -tests/qapi-schema/args-array-unknown.json:2: Member 'array' of 'data' for command 'oops' uses unknown type 'NoSuchType' +tests/qapi-schema/args-array-unknown.json:2: member 'array' of 'data' for command 'oops' uses unknown type 'NoSuchType' diff --git a/tests/qapi-schema/args-member-array-bad.err b/tests/qapi-schema/args-member-array-bad.err index 81e1e95523..89b8b1ce01 100644 --- a/tests/qapi-schema/args-member-array-bad.err +++ b/tests/qapi-schema/args-member-array-bad.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-member-array-bad.json: In command 'oops': -tests/qapi-schema/args-member-array-bad.json:2: Member 'member' of 'data' for command 'oops': array type must contain single type name +tests/qapi-schema/args-member-array-bad.json:2: member 'member' of 'data' for command 'oops': array type must contain single type name diff --git a/tests/qapi-schema/args-member-case.err b/tests/qapi-schema/args-member-case.err index da183957b2..faa8168d36 100644 --- a/tests/qapi-schema/args-member-case.err +++ b/tests/qapi-schema/args-member-case.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-member-case.json: In command 'no-way-this-will-get-whitelisted': -tests/qapi-schema/args-member-case.json:2: Member of 'data' for command 'no-way-this-will-get-whitelisted' uses uppercase in name 'Arg' +tests/qapi-schema/args-member-case.json:2: member of 'data' for command 'no-way-this-will-get-whitelisted' uses uppercase in name 'Arg' diff --git a/tests/qapi-schema/args-member-unknown.err b/tests/qapi-schema/args-member-unknown.err index 9d43e54ca9..168e24a4b8 100644 --- a/tests/qapi-schema/args-member-unknown.err +++ b/tests/qapi-schema/args-member-unknown.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-member-unknown.json: In command 'oops': -tests/qapi-schema/args-member-unknown.json:2: Member 'member' of 'data' for command 'oops' uses unknown type 'NoSuchType' +tests/qapi-schema/args-member-unknown.json:2: member 'member' of 'data' for command 'oops' uses unknown type 'NoSuchType' diff --git a/tests/qapi-schema/bad-type-int.err b/tests/qapi-schema/bad-type-int.err index 9b2c12c1eb..7f5916ea29 100644 --- a/tests/qapi-schema/bad-type-int.err +++ b/tests/qapi-schema/bad-type-int.err @@ -1 +1 @@ -tests/qapi-schema/bad-type-int.json:3:13: Stray '123' +tests/qapi-schema/bad-type-int.json:3:13: stray '123' diff --git a/tests/qapi-schema/base-cycle-direct.err b/tests/qapi-schema/base-cycle-direct.err index 52c21bc2b8..233e4b8952 100644 --- a/tests/qapi-schema/base-cycle-direct.err +++ b/tests/qapi-schema/base-cycle-direct.err @@ -1,2 +1,2 @@ tests/qapi-schema/base-cycle-direct.json: In struct 'Loopy': -tests/qapi-schema/base-cycle-direct.json:2: Object Loopy contains itself +tests/qapi-schema/base-cycle-direct.json:2: object Loopy contains itself diff --git a/tests/qapi-schema/base-cycle-indirect.err b/tests/qapi-schema/base-cycle-indirect.err index 1f60cd78f6..4472f30ba1 100644 --- a/tests/qapi-schema/base-cycle-indirect.err +++ b/tests/qapi-schema/base-cycle-indirect.err @@ -1,2 +1,2 @@ tests/qapi-schema/base-cycle-indirect.json: In struct 'Base1': -tests/qapi-schema/base-cycle-indirect.json:2: Object Base1 contains itself +tests/qapi-schema/base-cycle-indirect.json:2: object Base1 contains itself diff --git a/tests/qapi-schema/doc-bad-alternate-member.err b/tests/qapi-schema/doc-bad-alternate-member.err index 387f7824da..19a1ffd76e 100644 --- a/tests/qapi-schema/doc-bad-alternate-member.err +++ b/tests/qapi-schema/doc-bad-alternate-member.err @@ -1 +1 @@ -tests/qapi-schema/doc-bad-alternate-member.json:3: The following documented members are not in the declaration: aa, bb +tests/qapi-schema/doc-bad-alternate-member.json:3: the following documented members are not in the declaration: aa, bb diff --git a/tests/qapi-schema/doc-bad-command-arg.err b/tests/qapi-schema/doc-bad-command-arg.err index 8075b146ae..6962ebed69 100644 --- a/tests/qapi-schema/doc-bad-command-arg.err +++ b/tests/qapi-schema/doc-bad-command-arg.err @@ -1 +1 @@ -tests/qapi-schema/doc-bad-command-arg.json:3: The following documented members are not in the declaration: b +tests/qapi-schema/doc-bad-command-arg.json:3: the following documented members are not in the declaration: b diff --git a/tests/qapi-schema/doc-bad-symbol.err b/tests/qapi-schema/doc-bad-symbol.err index 375cdff939..205d0ed619 100644 --- a/tests/qapi-schema/doc-bad-symbol.err +++ b/tests/qapi-schema/doc-bad-symbol.err @@ -1,2 +1,2 @@ tests/qapi-schema/doc-bad-symbol.json: In command 'foo': -tests/qapi-schema/doc-bad-symbol.json:6: Definition of 'foo' follows documentation for 'food' +tests/qapi-schema/doc-bad-symbol.json:6: definition of 'foo' follows documentation for 'food' diff --git a/tests/qapi-schema/doc-bad-union-member.err b/tests/qapi-schema/doc-bad-union-member.err index 4b016df7ff..da3cd806e3 100644 --- a/tests/qapi-schema/doc-bad-union-member.err +++ b/tests/qapi-schema/doc-bad-union-member.err @@ -1 +1 @@ -tests/qapi-schema/doc-bad-union-member.json:3: The following documented members are not in the declaration: a, b +tests/qapi-schema/doc-bad-union-member.json:3: the following documented members are not in the declaration: a, b diff --git a/tests/qapi-schema/doc-before-include.err b/tests/qapi-schema/doc-before-include.err index a649d38a63..e5566f11e9 100644 --- a/tests/qapi-schema/doc-before-include.err +++ b/tests/qapi-schema/doc-before-include.err @@ -1 +1 @@ -tests/qapi-schema/doc-before-include.json:3: Documentation for 'foo' is not followed by the definition +tests/qapi-schema/doc-before-include.json:3: documentation for 'foo' is not followed by the definition diff --git a/tests/qapi-schema/doc-before-pragma.err b/tests/qapi-schema/doc-before-pragma.err index c0fb0660d1..8a97ebb578 100644 --- a/tests/qapi-schema/doc-before-pragma.err +++ b/tests/qapi-schema/doc-before-pragma.err @@ -1 +1 @@ -tests/qapi-schema/doc-before-pragma.json:3: Documentation for 'foo' is not followed by the definition +tests/qapi-schema/doc-before-pragma.json:3: documentation for 'foo' is not followed by the definition diff --git a/tests/qapi-schema/doc-duplicated-return.err b/tests/qapi-schema/doc-duplicated-return.err index e48039f8e5..7631933093 100644 --- a/tests/qapi-schema/doc-duplicated-return.err +++ b/tests/qapi-schema/doc-duplicated-return.err @@ -1 +1 @@ -tests/qapi-schema/doc-duplicated-return.json:7:1: Duplicated 'Returns' section +tests/qapi-schema/doc-duplicated-return.json:7:1: duplicated 'Returns' section diff --git a/tests/qapi-schema/doc-duplicated-since.err b/tests/qapi-schema/doc-duplicated-since.err index 3fb890744a..5ee15ae2a1 100644 --- a/tests/qapi-schema/doc-duplicated-since.err +++ b/tests/qapi-schema/doc-duplicated-since.err @@ -1 +1 @@ -tests/qapi-schema/doc-duplicated-since.json:7:1: Duplicated 'Since' section +tests/qapi-schema/doc-duplicated-since.json:7:1: duplicated 'Since' section diff --git a/tests/qapi-schema/doc-empty-arg.err b/tests/qapi-schema/doc-empty-arg.err index 2895518fa7..3c78a37ae1 100644 --- a/tests/qapi-schema/doc-empty-arg.err +++ b/tests/qapi-schema/doc-empty-arg.err @@ -1 +1 @@ -tests/qapi-schema/doc-empty-arg.json:5:1: Invalid parameter name +tests/qapi-schema/doc-empty-arg.json:5:1: invalid parameter name diff --git a/tests/qapi-schema/doc-empty-section.err b/tests/qapi-schema/doc-empty-section.err index b61e4a7886..f6586c566f 100644 --- a/tests/qapi-schema/doc-empty-section.err +++ b/tests/qapi-schema/doc-empty-section.err @@ -1 +1 @@ -tests/qapi-schema/doc-empty-section.json:7:1: Empty doc section 'Note' +tests/qapi-schema/doc-empty-section.json:7:1: empty doc section 'Note' diff --git a/tests/qapi-schema/doc-empty-symbol.err b/tests/qapi-schema/doc-empty-symbol.err index 1936ad094f..2dcddca7f6 100644 --- a/tests/qapi-schema/doc-empty-symbol.err +++ b/tests/qapi-schema/doc-empty-symbol.err @@ -1 +1 @@ -tests/qapi-schema/doc-empty-symbol.json:4:1: Invalid name +tests/qapi-schema/doc-empty-symbol.json:4:1: invalid name diff --git a/tests/qapi-schema/doc-invalid-end.err b/tests/qapi-schema/doc-invalid-end.err index 2bda28cb54..6345aa6a0f 100644 --- a/tests/qapi-schema/doc-invalid-end.err +++ b/tests/qapi-schema/doc-invalid-end.err @@ -1 +1 @@ -tests/qapi-schema/doc-invalid-end.json:5:2: Documentation comment must end with '##' +tests/qapi-schema/doc-invalid-end.json:5:2: documentation comment must end with '##' diff --git a/tests/qapi-schema/doc-invalid-end2.err b/tests/qapi-schema/doc-invalid-end2.err index 6fad9c789e..13ead36fd2 100644 --- a/tests/qapi-schema/doc-invalid-end2.err +++ b/tests/qapi-schema/doc-invalid-end2.err @@ -1 +1 @@ -tests/qapi-schema/doc-invalid-end2.json:5:1: Junk after '##' at end of documentation comment +tests/qapi-schema/doc-invalid-end2.json:5:1: junk after '##' at end of documentation comment diff --git a/tests/qapi-schema/doc-invalid-start.err b/tests/qapi-schema/doc-invalid-start.err index 149af2bfac..dcaa9699d6 100644 --- a/tests/qapi-schema/doc-invalid-start.err +++ b/tests/qapi-schema/doc-invalid-start.err @@ -1 +1 @@ -tests/qapi-schema/doc-invalid-start.json:3:1: Junk after '##' at start of documentation comment +tests/qapi-schema/doc-invalid-start.json:3:1: junk after '##' at start of documentation comment diff --git a/tests/qapi-schema/doc-missing-colon.err b/tests/qapi-schema/doc-missing-colon.err index b41d5078b0..6fb5a380bd 100644 --- a/tests/qapi-schema/doc-missing-colon.err +++ b/tests/qapi-schema/doc-missing-colon.err @@ -1 +1 @@ -tests/qapi-schema/doc-missing-colon.json:4:1: Line should end with ':' +tests/qapi-schema/doc-missing-colon.json:4:1: line should end with ':' diff --git a/tests/qapi-schema/doc-missing-expr.err b/tests/qapi-schema/doc-missing-expr.err index c909e26eca..622a37cc6c 100644 --- a/tests/qapi-schema/doc-missing-expr.err +++ b/tests/qapi-schema/doc-missing-expr.err @@ -1 +1 @@ -tests/qapi-schema/doc-missing-expr.json:3: Documentation for 'bar' is not followed by the definition +tests/qapi-schema/doc-missing-expr.json:3: documentation for 'bar' is not followed by the definition diff --git a/tests/qapi-schema/doc-missing-space.err b/tests/qapi-schema/doc-missing-space.err index d6b46ffd77..1187ba12c4 100644 --- a/tests/qapi-schema/doc-missing-space.err +++ b/tests/qapi-schema/doc-missing-space.err @@ -1 +1 @@ -tests/qapi-schema/doc-missing-space.json:5:1: Missing space after # +tests/qapi-schema/doc-missing-space.json:5:1: missing space after # diff --git a/tests/qapi-schema/doc-missing.err b/tests/qapi-schema/doc-missing.err index 3a377ddc57..08c827931a 100644 --- a/tests/qapi-schema/doc-missing.err +++ b/tests/qapi-schema/doc-missing.err @@ -1 +1 @@ -tests/qapi-schema/doc-missing.json:5: Definition missing documentation comment +tests/qapi-schema/doc-missing.json:5: definition missing documentation comment diff --git a/tests/qapi-schema/doc-no-symbol.err b/tests/qapi-schema/doc-no-symbol.err index 212984ff20..9a3057730c 100644 --- a/tests/qapi-schema/doc-no-symbol.err +++ b/tests/qapi-schema/doc-no-symbol.err @@ -1 +1 @@ -tests/qapi-schema/doc-no-symbol.json:3: Definition documentation required +tests/qapi-schema/doc-no-symbol.json:3: definition documentation required diff --git a/tests/qapi-schema/double-type.err b/tests/qapi-schema/double-type.err index 69457173a7..44a9dfdd55 100644 --- a/tests/qapi-schema/double-type.err +++ b/tests/qapi-schema/double-type.err @@ -1,2 +1,2 @@ -tests/qapi-schema/double-type.json:2: Unknown key 'command' in struct 'bar' +tests/qapi-schema/double-type.json:2: unknown key 'command' in struct 'bar' Valid keys are 'base', 'data', 'features', 'if', 'struct'. diff --git a/tests/qapi-schema/duplicate-key.err b/tests/qapi-schema/duplicate-key.err index 3af2f55174..7f34a34eb6 100644 --- a/tests/qapi-schema/duplicate-key.err +++ b/tests/qapi-schema/duplicate-key.err @@ -1 +1 @@ -tests/qapi-schema/duplicate-key.json:3:10: Duplicate key 'key' +tests/qapi-schema/duplicate-key.json:3:10: duplicate key 'key' diff --git a/tests/qapi-schema/enum-bad-member.err b/tests/qapi-schema/enum-bad-member.err index 49e4160dc4..1e59d42fca 100644 --- a/tests/qapi-schema/enum-bad-member.err +++ b/tests/qapi-schema/enum-bad-member.err @@ -1,2 +1,2 @@ tests/qapi-schema/enum-bad-member.json: In enum 'MyEnum': -tests/qapi-schema/enum-bad-member.json:2: Member of enum 'MyEnum' requires a string name +tests/qapi-schema/enum-bad-member.json:2: member of enum 'MyEnum' requires a string name diff --git a/tests/qapi-schema/enum-bad-name.err b/tests/qapi-schema/enum-bad-name.err index 3af7345792..ed2d608098 100644 --- a/tests/qapi-schema/enum-bad-name.err +++ b/tests/qapi-schema/enum-bad-name.err @@ -1,2 +1,2 @@ tests/qapi-schema/enum-bad-name.json: In enum 'MyEnum': -tests/qapi-schema/enum-bad-name.json:3: Member of enum 'MyEnum' uses invalid name 'not\possible' +tests/qapi-schema/enum-bad-name.json:3: member of enum 'MyEnum' uses invalid name 'not\possible' diff --git a/tests/qapi-schema/enum-bad-prefix.err b/tests/qapi-schema/enum-bad-prefix.err index 383ebaea7e..4f92736e52 100644 --- a/tests/qapi-schema/enum-bad-prefix.err +++ b/tests/qapi-schema/enum-bad-prefix.err @@ -1,2 +1,2 @@ tests/qapi-schema/enum-bad-prefix.json: In enum 'MyEnum': -tests/qapi-schema/enum-bad-prefix.json:2: Enum 'MyEnum' requires a string for 'prefix' +tests/qapi-schema/enum-bad-prefix.json:2: enum 'MyEnum' requires a string for 'prefix' diff --git a/tests/qapi-schema/enum-dict-member-unknown.err b/tests/qapi-schema/enum-dict-member-unknown.err index 02952f472a..79062729a1 100644 --- a/tests/qapi-schema/enum-dict-member-unknown.err +++ b/tests/qapi-schema/enum-dict-member-unknown.err @@ -1,3 +1,3 @@ tests/qapi-schema/enum-dict-member-unknown.json: In enum 'MyEnum': -tests/qapi-schema/enum-dict-member-unknown.json:2: Unknown key 'bad-key' in member of enum 'MyEnum' +tests/qapi-schema/enum-dict-member-unknown.json:2: unknown key 'bad-key' in member of enum 'MyEnum' Valid keys are 'if', 'name'. diff --git a/tests/qapi-schema/enum-int-member.err b/tests/qapi-schema/enum-int-member.err index 3f8d7b5b71..27f06e334c 100644 --- a/tests/qapi-schema/enum-int-member.err +++ b/tests/qapi-schema/enum-int-member.err @@ -1 +1 @@ -tests/qapi-schema/enum-int-member.json:3:31: Stray '1' +tests/qapi-schema/enum-int-member.json:3:31: stray '1' diff --git a/tests/qapi-schema/enum-member-case.err b/tests/qapi-schema/enum-member-case.err index 8f2007c86f..c3c6f8d709 100644 --- a/tests/qapi-schema/enum-member-case.err +++ b/tests/qapi-schema/enum-member-case.err @@ -1,2 +1,2 @@ tests/qapi-schema/enum-member-case.json: In enum 'NoWayThisWillGetWhitelisted': -tests/qapi-schema/enum-member-case.json:4: Member of enum 'NoWayThisWillGetWhitelisted' uses uppercase in name 'Value' +tests/qapi-schema/enum-member-case.json:4: member of enum 'NoWayThisWillGetWhitelisted' uses uppercase in name 'Value' diff --git a/tests/qapi-schema/enum-missing-data.err b/tests/qapi-schema/enum-missing-data.err index ba4873ae69..3c3c52d037 100644 --- a/tests/qapi-schema/enum-missing-data.err +++ b/tests/qapi-schema/enum-missing-data.err @@ -1 +1 @@ -tests/qapi-schema/enum-missing-data.json:2: Key 'data' is missing from enum 'MyEnum' +tests/qapi-schema/enum-missing-data.json:2: key 'data' is missing from enum 'MyEnum' diff --git a/tests/qapi-schema/enum-wrong-data.err b/tests/qapi-schema/enum-wrong-data.err index 4ab0c44e48..ab9af5e995 100644 --- a/tests/qapi-schema/enum-wrong-data.err +++ b/tests/qapi-schema/enum-wrong-data.err @@ -1,2 +1,2 @@ tests/qapi-schema/enum-wrong-data.json: In enum 'MyEnum': -tests/qapi-schema/enum-wrong-data.json:2: Enum 'MyEnum' requires an array for 'data' +tests/qapi-schema/enum-wrong-data.json:2: enum 'MyEnum' requires an array for 'data' diff --git a/tests/qapi-schema/escape-outside-string.err b/tests/qapi-schema/escape-outside-string.err index efee335ba0..06f5f2ed55 100644 --- a/tests/qapi-schema/escape-outside-string.err +++ b/tests/qapi-schema/escape-outside-string.err @@ -1 +1 @@ -tests/qapi-schema/escape-outside-string.json:3:27: Stray '\' +tests/qapi-schema/escape-outside-string.json:3:27: stray '\' diff --git a/tests/qapi-schema/event-boxed-empty.err b/tests/qapi-schema/event-boxed-empty.err index 6ccbdf7b22..9c691b7d97 100644 --- a/tests/qapi-schema/event-boxed-empty.err +++ b/tests/qapi-schema/event-boxed-empty.err @@ -1,2 +1,2 @@ tests/qapi-schema/event-boxed-empty.json: In event 'FOO': -tests/qapi-schema/event-boxed-empty.json:2: Use of 'boxed' requires 'data' +tests/qapi-schema/event-boxed-empty.json:2: use of 'boxed' requires 'data' diff --git a/tests/qapi-schema/event-member-invalid-dict.err b/tests/qapi-schema/event-member-invalid-dict.err index 9981a48b81..8bf89b7a3a 100644 --- a/tests/qapi-schema/event-member-invalid-dict.err +++ b/tests/qapi-schema/event-member-invalid-dict.err @@ -1,2 +1,2 @@ tests/qapi-schema/event-member-invalid-dict.json: In event 'EVENT_A': -tests/qapi-schema/event-member-invalid-dict.json:1: Key 'type' is missing from member 'a' of 'data' for event 'EVENT_A' +tests/qapi-schema/event-member-invalid-dict.json:1: key 'type' is missing from member 'a' of 'data' for event 'EVENT_A' diff --git a/tests/qapi-schema/event-nest-struct.err b/tests/qapi-schema/event-nest-struct.err index 2dd57f1784..8900052e83 100644 --- a/tests/qapi-schema/event-nest-struct.err +++ b/tests/qapi-schema/event-nest-struct.err @@ -1,2 +1,2 @@ tests/qapi-schema/event-nest-struct.json: In event 'EVENT_A': -tests/qapi-schema/event-nest-struct.json:1: Member 'a' of 'data' for event 'EVENT_A' should be a type name +tests/qapi-schema/event-nest-struct.json:1: member 'a' of 'data' for event 'EVENT_A' should be a type name diff --git a/tests/qapi-schema/features-bad-type.err b/tests/qapi-schema/features-bad-type.err index a08485387a..2182c3ec75 100644 --- a/tests/qapi-schema/features-bad-type.err +++ b/tests/qapi-schema/features-bad-type.err @@ -1,2 +1,2 @@ tests/qapi-schema/features-bad-type.json: In struct 'FeatureStruct0': -tests/qapi-schema/features-bad-type.json:1: Feature of struct FeatureStruct0 requires a string name +tests/qapi-schema/features-bad-type.json:1: feature of struct FeatureStruct0 requires a string name diff --git a/tests/qapi-schema/features-missing-name.err b/tests/qapi-schema/features-missing-name.err index d445936b0c..8cbf1ef3f0 100644 --- a/tests/qapi-schema/features-missing-name.err +++ b/tests/qapi-schema/features-missing-name.err @@ -1,2 +1,2 @@ tests/qapi-schema/features-missing-name.json: In struct 'FeatureStruct0': -tests/qapi-schema/features-missing-name.json:1: Key 'name' is missing from feature of struct FeatureStruct0 +tests/qapi-schema/features-missing-name.json:1: key 'name' is missing from feature of struct FeatureStruct0 diff --git a/tests/qapi-schema/features-name-bad-type.err b/tests/qapi-schema/features-name-bad-type.err index cc4bd33e7f..19a7b61214 100644 --- a/tests/qapi-schema/features-name-bad-type.err +++ b/tests/qapi-schema/features-name-bad-type.err @@ -1,2 +1,2 @@ tests/qapi-schema/features-name-bad-type.json: In struct 'FeatureStruct0': -tests/qapi-schema/features-name-bad-type.json:1: Feature of struct FeatureStruct0 requires a string name +tests/qapi-schema/features-name-bad-type.json:1: feature of struct FeatureStruct0 requires a string name diff --git a/tests/qapi-schema/features-no-list.err b/tests/qapi-schema/features-no-list.err index 663d9cd158..28f91824bd 100644 --- a/tests/qapi-schema/features-no-list.err +++ b/tests/qapi-schema/features-no-list.err @@ -1,2 +1,2 @@ tests/qapi-schema/features-no-list.json: In struct 'FeatureStruct0': -tests/qapi-schema/features-no-list.json:1: Struct 'FeatureStruct0' requires an array for 'features' +tests/qapi-schema/features-no-list.json:1: struct 'FeatureStruct0' requires an array for 'features' diff --git a/tests/qapi-schema/features-unknown-key.err b/tests/qapi-schema/features-unknown-key.err index 2aeca4c1a6..78e63c8cf7 100644 --- a/tests/qapi-schema/features-unknown-key.err +++ b/tests/qapi-schema/features-unknown-key.err @@ -1,3 +1,3 @@ tests/qapi-schema/features-unknown-key.json: In struct 'FeatureStruct0': -tests/qapi-schema/features-unknown-key.json:1: Unknown key 'colour' in feature of struct FeatureStruct0 +tests/qapi-schema/features-unknown-key.json:1: unknown key 'colour' in feature of struct FeatureStruct0 Valid keys are 'if', 'name'. diff --git a/tests/qapi-schema/flat-union-array-branch.err b/tests/qapi-schema/flat-union-array-branch.err index 13b4e60658..323d79737c 100644 --- a/tests/qapi-schema/flat-union-array-branch.err +++ b/tests/qapi-schema/flat-union-array-branch.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-array-branch.json: In union 'TestUnion': -tests/qapi-schema/flat-union-array-branch.json:8: Member 'value1' of union 'TestUnion' cannot be an array +tests/qapi-schema/flat-union-array-branch.json:8: member 'value1' of union 'TestUnion' cannot be an array diff --git a/tests/qapi-schema/flat-union-bad-discriminator.err b/tests/qapi-schema/flat-union-bad-discriminator.err index 9b3746343f..27a6c9f3fb 100644 --- a/tests/qapi-schema/flat-union-bad-discriminator.err +++ b/tests/qapi-schema/flat-union-bad-discriminator.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-bad-discriminator.json: In union 'TestUnion': -tests/qapi-schema/flat-union-bad-discriminator.json:11: Discriminator of flat union 'TestUnion' requires a string name +tests/qapi-schema/flat-union-bad-discriminator.json:11: discriminator of flat union 'TestUnion' requires a string name diff --git a/tests/qapi-schema/flat-union-discriminator-bad-name.err b/tests/qapi-schema/flat-union-discriminator-bad-name.err index 72dc328bad..f7f64c5c1a 100644 --- a/tests/qapi-schema/flat-union-discriminator-bad-name.err +++ b/tests/qapi-schema/flat-union-discriminator-bad-name.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-discriminator-bad-name.json: In union 'MyUnion': -tests/qapi-schema/flat-union-discriminator-bad-name.json:7: Discriminator of flat union 'MyUnion' does not allow optional name '*switch' +tests/qapi-schema/flat-union-discriminator-bad-name.json:7: discriminator of flat union 'MyUnion' does not allow optional name '*switch' diff --git a/tests/qapi-schema/flat-union-empty.err b/tests/qapi-schema/flat-union-empty.err index 3fa79a6a47..96fe46b918 100644 --- a/tests/qapi-schema/flat-union-empty.err +++ b/tests/qapi-schema/flat-union-empty.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-empty.json: In union 'Union': -tests/qapi-schema/flat-union-empty.json:4: Union 'Union' has no branches +tests/qapi-schema/flat-union-empty.json:4: union 'Union' has no branches diff --git a/tests/qapi-schema/flat-union-inline-invalid-dict.err b/tests/qapi-schema/flat-union-inline-invalid-dict.err index 3716c02a9b..85739c2733 100644 --- a/tests/qapi-schema/flat-union-inline-invalid-dict.err +++ b/tests/qapi-schema/flat-union-inline-invalid-dict.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-inline-invalid-dict.json: In union 'TestUnion': -tests/qapi-schema/flat-union-inline-invalid-dict.json:7: Key 'type' is missing from member 'value1' of union 'TestUnion' +tests/qapi-schema/flat-union-inline-invalid-dict.json:7: key 'type' is missing from member 'value1' of union 'TestUnion' diff --git a/tests/qapi-schema/flat-union-inline.err b/tests/qapi-schema/flat-union-inline.err index 0a7a94b03f..33a8d6e3bd 100644 --- a/tests/qapi-schema/flat-union-inline.err +++ b/tests/qapi-schema/flat-union-inline.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-inline.json: In union 'TestUnion': -tests/qapi-schema/flat-union-inline.json:7: Member 'value1' of union 'TestUnion' should be a type name +tests/qapi-schema/flat-union-inline.json:7: member 'value1' of union 'TestUnion' should be a type name diff --git a/tests/qapi-schema/flat-union-int-branch.err b/tests/qapi-schema/flat-union-int-branch.err index 075751bcf6..2bbb8bf22e 100644 --- a/tests/qapi-schema/flat-union-int-branch.err +++ b/tests/qapi-schema/flat-union-int-branch.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-int-branch.json: In union 'TestUnion': -tests/qapi-schema/flat-union-int-branch.json:8: Member 'value1' of union 'TestUnion' cannot use built-in type 'int' +tests/qapi-schema/flat-union-int-branch.json:8: member 'value1' of union 'TestUnion' cannot use built-in type 'int' diff --git a/tests/qapi-schema/flat-union-invalid-branch-key.err b/tests/qapi-schema/flat-union-invalid-branch-key.err index a4d0e3ee66..da4377be69 100644 --- a/tests/qapi-schema/flat-union-invalid-branch-key.err +++ b/tests/qapi-schema/flat-union-invalid-branch-key.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-invalid-branch-key.json: In union 'TestUnion': -tests/qapi-schema/flat-union-invalid-branch-key.json:13: Discriminator value 'value_wrong' is not found in enum 'TestEnum' +tests/qapi-schema/flat-union-invalid-branch-key.json:13: discriminator value 'value_wrong' is not found in enum 'TestEnum' diff --git a/tests/qapi-schema/flat-union-invalid-discriminator.err b/tests/qapi-schema/flat-union-invalid-discriminator.err index ca9a413dae..3f80de3044 100644 --- a/tests/qapi-schema/flat-union-invalid-discriminator.err +++ b/tests/qapi-schema/flat-union-invalid-discriminator.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-invalid-discriminator.json: In union 'TestUnion': -tests/qapi-schema/flat-union-invalid-discriminator.json:10: Discriminator 'enum_wrong' is not a member of 'base' +tests/qapi-schema/flat-union-invalid-discriminator.json:10: discriminator 'enum_wrong' is not a member of 'base' diff --git a/tests/qapi-schema/flat-union-invalid-if-discriminator.err b/tests/qapi-schema/flat-union-invalid-if-discriminator.err index c06307db98..be770d6baa 100644 --- a/tests/qapi-schema/flat-union-invalid-if-discriminator.err +++ b/tests/qapi-schema/flat-union-invalid-if-discriminator.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-invalid-if-discriminator.json: In union 'TestUnion': -tests/qapi-schema/flat-union-invalid-if-discriminator.json:10: The discriminator 'enum1' for union TestUnion must not be conditional +tests/qapi-schema/flat-union-invalid-if-discriminator.json:10: the discriminator 'enum1' for union TestUnion must not be conditional diff --git a/tests/qapi-schema/flat-union-no-base.err b/tests/qapi-schema/flat-union-no-base.err index 6e2035495c..c845259824 100644 --- a/tests/qapi-schema/flat-union-no-base.err +++ b/tests/qapi-schema/flat-union-no-base.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-no-base.json: In union 'TestUnion': -tests/qapi-schema/flat-union-no-base.json:9: Flat union 'TestUnion' must have a base +tests/qapi-schema/flat-union-no-base.json:9: flat union 'TestUnion' must have a base diff --git a/tests/qapi-schema/flat-union-optional-discriminator.err b/tests/qapi-schema/flat-union-optional-discriminator.err index db268fffaa..536ac775e2 100644 --- a/tests/qapi-schema/flat-union-optional-discriminator.err +++ b/tests/qapi-schema/flat-union-optional-discriminator.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-optional-discriminator.json: In union 'MyUnion': -tests/qapi-schema/flat-union-optional-discriminator.json:7: Discriminator 'switch' is not a member of 'base' +tests/qapi-schema/flat-union-optional-discriminator.json:7: discriminator 'switch' is not a member of 'base' diff --git a/tests/qapi-schema/flat-union-string-discriminator.err b/tests/qapi-schema/flat-union-string-discriminator.err index 9bca7082bb..f5635a5774 100644 --- a/tests/qapi-schema/flat-union-string-discriminator.err +++ b/tests/qapi-schema/flat-union-string-discriminator.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-string-discriminator.json: In union 'TestUnion': -tests/qapi-schema/flat-union-string-discriminator.json:13: Discriminator 'kind' must be of enumeration type +tests/qapi-schema/flat-union-string-discriminator.json:13: discriminator 'kind' must be of enumeration type diff --git a/tests/qapi-schema/funny-char.err b/tests/qapi-schema/funny-char.err index 139ecf4eb8..132fac93ea 100644 --- a/tests/qapi-schema/funny-char.err +++ b/tests/qapi-schema/funny-char.err @@ -1 +1 @@ -tests/qapi-schema/funny-char.json:2:36: Stray ';' +tests/qapi-schema/funny-char.json:2:36: stray ';' diff --git a/tests/qapi-schema/funny-word.err b/tests/qapi-schema/funny-word.err index af92fe2551..d9286c8962 100644 --- a/tests/qapi-schema/funny-word.err +++ b/tests/qapi-schema/funny-word.err @@ -1 +1 @@ -tests/qapi-schema/funny-word.json:1:3: Stray 'command' +tests/qapi-schema/funny-word.json:1:3: stray 'command' diff --git a/tests/qapi-schema/ident-with-escape.err b/tests/qapi-schema/ident-with-escape.err index 5517dcb4b1..1117283c81 100644 --- a/tests/qapi-schema/ident-with-escape.err +++ b/tests/qapi-schema/ident-with-escape.err @@ -1 +1 @@ -tests/qapi-schema/ident-with-escape.json:3:3: Unknown escape \u +tests/qapi-schema/ident-with-escape.json:3:3: unknown escape \u diff --git a/tests/qapi-schema/include-before-err.err b/tests/qapi-schema/include-before-err.err index 2b26322170..098314bc49 100644 --- a/tests/qapi-schema/include-before-err.err +++ b/tests/qapi-schema/include-before-err.err @@ -1 +1 @@ -tests/qapi-schema/include-before-err.json:2:13: Expected ':' +tests/qapi-schema/include-before-err.json:2:13: expected ':' diff --git a/tests/qapi-schema/include-cycle.err b/tests/qapi-schema/include-cycle.err index bdcd07dce2..52028669b5 100644 --- a/tests/qapi-schema/include-cycle.err +++ b/tests/qapi-schema/include-cycle.err @@ -1,3 +1,3 @@ In file included from tests/qapi-schema/include-cycle.json:1: In file included from tests/qapi-schema/include-cycle-b.json:1: -tests/qapi-schema/include-cycle-c.json:1: Inclusion loop for include-cycle.json +tests/qapi-schema/include-cycle-c.json:1: inclusion loop for include-cycle.json diff --git a/tests/qapi-schema/include-extra-junk.err b/tests/qapi-schema/include-extra-junk.err index e6ef2a3720..854cec3ce3 100644 --- a/tests/qapi-schema/include-extra-junk.err +++ b/tests/qapi-schema/include-extra-junk.err @@ -1 +1 @@ -tests/qapi-schema/include-extra-junk.json:3: Invalid 'include' directive +tests/qapi-schema/include-extra-junk.json:3: invalid 'include' directive diff --git a/tests/qapi-schema/include-nested-err.err b/tests/qapi-schema/include-nested-err.err index aec6207eb0..11928b4f7f 100644 --- a/tests/qapi-schema/include-nested-err.err +++ b/tests/qapi-schema/include-nested-err.err @@ -1,2 +1,2 @@ In file included from tests/qapi-schema/include-nested-err.json:1: -tests/qapi-schema/missing-colon.json:1:10: Expected ':' +tests/qapi-schema/missing-colon.json:1:10: expected ':' diff --git a/tests/qapi-schema/include-non-file.err b/tests/qapi-schema/include-non-file.err index faae1eacf1..65dd3c7c2c 100644 --- a/tests/qapi-schema/include-non-file.err +++ b/tests/qapi-schema/include-non-file.err @@ -1 +1 @@ -tests/qapi-schema/include-non-file.json:1: Value of 'include' must be a string +tests/qapi-schema/include-non-file.json:1: value of 'include' must be a string diff --git a/tests/qapi-schema/include-self-cycle.err b/tests/qapi-schema/include-self-cycle.err index 981742ae5f..c84795d1dc 100644 --- a/tests/qapi-schema/include-self-cycle.err +++ b/tests/qapi-schema/include-self-cycle.err @@ -1 +1 @@ -tests/qapi-schema/include-self-cycle.json:1: Inclusion loop for include-self-cycle.json +tests/qapi-schema/include-self-cycle.json:1: inclusion loop for include-self-cycle.json diff --git a/tests/qapi-schema/leading-comma-list.err b/tests/qapi-schema/leading-comma-list.err index e021e42ad9..cddf471f71 100644 --- a/tests/qapi-schema/leading-comma-list.err +++ b/tests/qapi-schema/leading-comma-list.err @@ -1 +1 @@ -tests/qapi-schema/leading-comma-list.json:2:13: Expected '{', '[', ']', string, boolean or 'null' +tests/qapi-schema/leading-comma-list.json:2:13: expected '{', '[', ']', string, boolean or 'null' diff --git a/tests/qapi-schema/leading-comma-object.err b/tests/qapi-schema/leading-comma-object.err index 3852f123d2..2f3b193274 100644 --- a/tests/qapi-schema/leading-comma-object.err +++ b/tests/qapi-schema/leading-comma-object.err @@ -1 +1 @@ -tests/qapi-schema/leading-comma-object.json:1:3: Expected string or '}' +tests/qapi-schema/leading-comma-object.json:1:3: expected string or '}' diff --git a/tests/qapi-schema/missing-colon.err b/tests/qapi-schema/missing-colon.err index a255e51918..e642c7c549 100644 --- a/tests/qapi-schema/missing-colon.err +++ b/tests/qapi-schema/missing-colon.err @@ -1 +1 @@ -tests/qapi-schema/missing-colon.json:1:10: Expected ':' +tests/qapi-schema/missing-colon.json:1:10: expected ':' diff --git a/tests/qapi-schema/missing-comma-list.err b/tests/qapi-schema/missing-comma-list.err index df3f553f39..5359499430 100644 --- a/tests/qapi-schema/missing-comma-list.err +++ b/tests/qapi-schema/missing-comma-list.err @@ -1 +1 @@ -tests/qapi-schema/missing-comma-list.json:2:20: Expected ',' or ']' +tests/qapi-schema/missing-comma-list.json:2:20: expected ',' or ']' diff --git a/tests/qapi-schema/missing-comma-object.err b/tests/qapi-schema/missing-comma-object.err index 0f691b8ddd..c9b02b0760 100644 --- a/tests/qapi-schema/missing-comma-object.err +++ b/tests/qapi-schema/missing-comma-object.err @@ -1 +1 @@ -tests/qapi-schema/missing-comma-object.json:2:3: Expected ',' or '}' +tests/qapi-schema/missing-comma-object.json:2:3: expected ',' or '}' diff --git a/tests/qapi-schema/missing-type.err b/tests/qapi-schema/missing-type.err index b3e7b14e42..19b7c495e7 100644 --- a/tests/qapi-schema/missing-type.err +++ b/tests/qapi-schema/missing-type.err @@ -1 +1 @@ -tests/qapi-schema/missing-type.json:2: Expression is missing metatype +tests/qapi-schema/missing-type.json:2: expression is missing metatype diff --git a/tests/qapi-schema/nested-struct-data-invalid-dict.err b/tests/qapi-schema/nested-struct-data-invalid-dict.err index 4d9c9b491a..f2c7a8096c 100644 --- a/tests/qapi-schema/nested-struct-data-invalid-dict.err +++ b/tests/qapi-schema/nested-struct-data-invalid-dict.err @@ -1,2 +1,2 @@ tests/qapi-schema/nested-struct-data-invalid-dict.json: In command 'foo': -tests/qapi-schema/nested-struct-data-invalid-dict.json:2: Key 'type' is missing from member 'a' of 'data' for command 'foo' +tests/qapi-schema/nested-struct-data-invalid-dict.json:2: key 'type' is missing from member 'a' of 'data' for command 'foo' diff --git a/tests/qapi-schema/nested-struct-data.err b/tests/qapi-schema/nested-struct-data.err index 74d44ab111..b5e136674c 100644 --- a/tests/qapi-schema/nested-struct-data.err +++ b/tests/qapi-schema/nested-struct-data.err @@ -1,2 +1,2 @@ tests/qapi-schema/nested-struct-data.json: In command 'foo': -tests/qapi-schema/nested-struct-data.json:2: Member 'a' of 'data' for command 'foo' should be a type name +tests/qapi-schema/nested-struct-data.json:2: member 'a' of 'data' for command 'foo' should be a type name diff --git a/tests/qapi-schema/non-objects.err b/tests/qapi-schema/non-objects.err index a972abd937..9237af6939 100644 --- a/tests/qapi-schema/non-objects.err +++ b/tests/qapi-schema/non-objects.err @@ -1 +1 @@ -tests/qapi-schema/non-objects.json:1:1: Expected '{' +tests/qapi-schema/non-objects.json:1:1: expected '{' diff --git a/tests/qapi-schema/pragma-doc-required-crap.err b/tests/qapi-schema/pragma-doc-required-crap.err index 39cd56cd48..bcd981ada8 100644 --- a/tests/qapi-schema/pragma-doc-required-crap.err +++ b/tests/qapi-schema/pragma-doc-required-crap.err @@ -1 +1 @@ -tests/qapi-schema/pragma-doc-required-crap.json:3: Pragma 'doc-required' must be boolean +tests/qapi-schema/pragma-doc-required-crap.json:3: pragma 'doc-required' must be boolean diff --git a/tests/qapi-schema/pragma-extra-junk.err b/tests/qapi-schema/pragma-extra-junk.err index 4481688dbf..3ae48d3668 100644 --- a/tests/qapi-schema/pragma-extra-junk.err +++ b/tests/qapi-schema/pragma-extra-junk.err @@ -1 +1 @@ -tests/qapi-schema/pragma-extra-junk.json:3: Invalid 'pragma' directive +tests/qapi-schema/pragma-extra-junk.json:3: invalid 'pragma' directive diff --git a/tests/qapi-schema/pragma-name-case-whitelist-crap.err b/tests/qapi-schema/pragma-name-case-whitelist-crap.err index f83b97e075..81f829ff36 100644 --- a/tests/qapi-schema/pragma-name-case-whitelist-crap.err +++ b/tests/qapi-schema/pragma-name-case-whitelist-crap.err @@ -1 +1 @@ -tests/qapi-schema/pragma-name-case-whitelist-crap.json:3: Pragma name-case-whitelist must be a list of strings +tests/qapi-schema/pragma-name-case-whitelist-crap.json:3: pragma name-case-whitelist must be a list of strings diff --git a/tests/qapi-schema/pragma-non-dict.err b/tests/qapi-schema/pragma-non-dict.err index b358261050..8221724b0a 100644 --- a/tests/qapi-schema/pragma-non-dict.err +++ b/tests/qapi-schema/pragma-non-dict.err @@ -1 +1 @@ -tests/qapi-schema/pragma-non-dict.json:3: Value of 'pragma' must be an object +tests/qapi-schema/pragma-non-dict.json:3: value of 'pragma' must be an object diff --git a/tests/qapi-schema/pragma-returns-whitelist-crap.err b/tests/qapi-schema/pragma-returns-whitelist-crap.err index 5d77021674..c0cae5de18 100644 --- a/tests/qapi-schema/pragma-returns-whitelist-crap.err +++ b/tests/qapi-schema/pragma-returns-whitelist-crap.err @@ -1 +1 @@ -tests/qapi-schema/pragma-returns-whitelist-crap.json:3: Pragma returns-whitelist must be a list of strings +tests/qapi-schema/pragma-returns-whitelist-crap.json:3: pragma returns-whitelist must be a list of strings diff --git a/tests/qapi-schema/pragma-unknown.err b/tests/qapi-schema/pragma-unknown.err index 6ef2058316..f1335f0a0a 100644 --- a/tests/qapi-schema/pragma-unknown.err +++ b/tests/qapi-schema/pragma-unknown.err @@ -1 +1 @@ -tests/qapi-schema/pragma-unknown.json:1: Unknown pragma 'no-such-pragma' +tests/qapi-schema/pragma-unknown.json:1: unknown pragma 'no-such-pragma' diff --git a/tests/qapi-schema/quoted-structural-chars.err b/tests/qapi-schema/quoted-structural-chars.err index 6e036c8044..d8460a63a7 100644 --- a/tests/qapi-schema/quoted-structural-chars.err +++ b/tests/qapi-schema/quoted-structural-chars.err @@ -1 +1 @@ -tests/qapi-schema/quoted-structural-chars.json:1:1: Expected '{' +tests/qapi-schema/quoted-structural-chars.json:1:1: expected '{' diff --git a/tests/qapi-schema/reserved-enum-q.err b/tests/qapi-schema/reserved-enum-q.err index e3eecd29dc..d9c0af5a05 100644 --- a/tests/qapi-schema/reserved-enum-q.err +++ b/tests/qapi-schema/reserved-enum-q.err @@ -1,2 +1,2 @@ tests/qapi-schema/reserved-enum-q.json: In enum 'Foo': -tests/qapi-schema/reserved-enum-q.json:4: Member of enum 'Foo' uses invalid name 'q-Unix' +tests/qapi-schema/reserved-enum-q.json:4: member of enum 'Foo' uses invalid name 'q-Unix' diff --git a/tests/qapi-schema/reserved-member-has.err b/tests/qapi-schema/reserved-member-has.err index 2c6d0418db..6f405ec2a9 100644 --- a/tests/qapi-schema/reserved-member-has.err +++ b/tests/qapi-schema/reserved-member-has.err @@ -1,2 +1,2 @@ tests/qapi-schema/reserved-member-has.json: In command 'oops': -tests/qapi-schema/reserved-member-has.json:5: Member of 'data' for command 'oops' uses reserved name 'has-a' +tests/qapi-schema/reserved-member-has.json:5: member of 'data' for command 'oops' uses reserved name 'has-a' diff --git a/tests/qapi-schema/reserved-member-q.err b/tests/qapi-schema/reserved-member-q.err index eaabe579bc..ece2664005 100644 --- a/tests/qapi-schema/reserved-member-q.err +++ b/tests/qapi-schema/reserved-member-q.err @@ -1,2 +1,2 @@ tests/qapi-schema/reserved-member-q.json: In struct 'Foo': -tests/qapi-schema/reserved-member-q.json:4: Member of 'data' for struct 'Foo' uses invalid name 'q-unix' +tests/qapi-schema/reserved-member-q.json:4: member of 'data' for struct 'Foo' uses invalid name 'q-unix' diff --git a/tests/qapi-schema/reserved-member-u.err b/tests/qapi-schema/reserved-member-u.err index b01629da29..e812a1e404 100644 --- a/tests/qapi-schema/reserved-member-u.err +++ b/tests/qapi-schema/reserved-member-u.err @@ -1,2 +1,2 @@ tests/qapi-schema/reserved-member-u.json: In struct 'Oops': -tests/qapi-schema/reserved-member-u.json:7: Member of 'data' for struct 'Oops' uses reserved name 'u' +tests/qapi-schema/reserved-member-u.json:7: member of 'data' for struct 'Oops' uses reserved name 'u' diff --git a/tests/qapi-schema/reserved-member-underscore.err b/tests/qapi-schema/reserved-member-underscore.err index 6089cc1d3b..e1d54f0a27 100644 --- a/tests/qapi-schema/reserved-member-underscore.err +++ b/tests/qapi-schema/reserved-member-underscore.err @@ -1,2 +1,2 @@ tests/qapi-schema/reserved-member-underscore.json: In struct 'Oops': -tests/qapi-schema/reserved-member-underscore.json:4: Member of 'data' for struct 'Oops' uses invalid name '_oops' +tests/qapi-schema/reserved-member-underscore.json:4: member of 'data' for struct 'Oops' uses invalid name '_oops' diff --git a/tests/qapi-schema/string-code-point-127.err b/tests/qapi-schema/string-code-point-127.err index c310910c23..b4fa2610a9 100644 --- a/tests/qapi-schema/string-code-point-127.err +++ b/tests/qapi-schema/string-code-point-127.err @@ -1 +1 @@ -tests/qapi-schema/string-code-point-127.json:2:14: Funny character in string +tests/qapi-schema/string-code-point-127.json:2:14: funny character in string diff --git a/tests/qapi-schema/string-code-point-31.err b/tests/qapi-schema/string-code-point-31.err index 45797928d9..0bb5ce37b8 100644 --- a/tests/qapi-schema/string-code-point-31.err +++ b/tests/qapi-schema/string-code-point-31.err @@ -1 +1 @@ -tests/qapi-schema/string-code-point-31.json:2:14: Funny character in string +tests/qapi-schema/string-code-point-31.json:2:14: funny character in string diff --git a/tests/qapi-schema/struct-member-invalid-dict.err b/tests/qapi-schema/struct-member-invalid-dict.err index e8b0ee72e0..0c770bb1e8 100644 --- a/tests/qapi-schema/struct-member-invalid-dict.err +++ b/tests/qapi-schema/struct-member-invalid-dict.err @@ -1,2 +1,2 @@ tests/qapi-schema/struct-member-invalid-dict.json: In struct 'foo': -tests/qapi-schema/struct-member-invalid-dict.json:2: Key 'type' is missing from member '*a' of 'data' for struct 'foo' +tests/qapi-schema/struct-member-invalid-dict.json:2: key 'type' is missing from member '*a' of 'data' for struct 'foo' diff --git a/tests/qapi-schema/struct-member-invalid.err b/tests/qapi-schema/struct-member-invalid.err index 466c1af1d0..e5a19fc8af 100644 --- a/tests/qapi-schema/struct-member-invalid.err +++ b/tests/qapi-schema/struct-member-invalid.err @@ -1,2 +1,2 @@ tests/qapi-schema/struct-member-invalid.json: In struct 'foo': -tests/qapi-schema/struct-member-invalid.json:1: Member 'a' of 'data' for struct 'foo' should be a type name +tests/qapi-schema/struct-member-invalid.json:1: member 'a' of 'data' for struct 'foo' should be a type name diff --git a/tests/qapi-schema/trailing-comma-list.err b/tests/qapi-schema/trailing-comma-list.err index 601c4537c3..167d688beb 100644 --- a/tests/qapi-schema/trailing-comma-list.err +++ b/tests/qapi-schema/trailing-comma-list.err @@ -1 +1 @@ -tests/qapi-schema/trailing-comma-list.json:2:36: Expected '{', '[', string, boolean or 'null' +tests/qapi-schema/trailing-comma-list.json:2:36: expected '{', '[', string, boolean or 'null' diff --git a/tests/qapi-schema/trailing-comma-object.err b/tests/qapi-schema/trailing-comma-object.err index 30bce5e194..186df0fa45 100644 --- a/tests/qapi-schema/trailing-comma-object.err +++ b/tests/qapi-schema/trailing-comma-object.err @@ -1 +1 @@ -tests/qapi-schema/trailing-comma-object.json:2:38: Expected string +tests/qapi-schema/trailing-comma-object.json:2:38: expected string diff --git a/tests/qapi-schema/unclosed-list.err b/tests/qapi-schema/unclosed-list.err index 1cc3a094fe..6648a8e30b 100644 --- a/tests/qapi-schema/unclosed-list.err +++ b/tests/qapi-schema/unclosed-list.err @@ -1 +1 @@ -tests/qapi-schema/unclosed-list.json:1:20: Expected ',' or ']' +tests/qapi-schema/unclosed-list.json:1:20: expected ',' or ']' diff --git a/tests/qapi-schema/unclosed-object.err b/tests/qapi-schema/unclosed-object.err index fd1a86b704..54d221e3a9 100644 --- a/tests/qapi-schema/unclosed-object.err +++ b/tests/qapi-schema/unclosed-object.err @@ -1 +1 @@ -tests/qapi-schema/unclosed-object.json:1:21: Expected ',' or '}' +tests/qapi-schema/unclosed-object.json:1:21: expected ',' or '}' diff --git a/tests/qapi-schema/unclosed-string.err b/tests/qapi-schema/unclosed-string.err index 12b187074e..9439698fe0 100644 --- a/tests/qapi-schema/unclosed-string.err +++ b/tests/qapi-schema/unclosed-string.err @@ -1 +1 @@ -tests/qapi-schema/unclosed-string.json:1:11: Missing terminating "'" +tests/qapi-schema/unclosed-string.json:1:11: missing terminating "'" diff --git a/tests/qapi-schema/union-base-empty.err b/tests/qapi-schema/union-base-empty.err index 1e24341819..b76542d47a 100644 --- a/tests/qapi-schema/union-base-empty.err +++ b/tests/qapi-schema/union-base-empty.err @@ -1,2 +1,2 @@ tests/qapi-schema/union-base-empty.json: In union 'TestUnion': -tests/qapi-schema/union-base-empty.json:5: Discriminator 'type' is not a member of 'base' +tests/qapi-schema/union-base-empty.json:5: discriminator 'type' is not a member of 'base' diff --git a/tests/qapi-schema/union-base-no-discriminator.err b/tests/qapi-schema/union-base-no-discriminator.err index fa9343fb8e..883a98866b 100644 --- a/tests/qapi-schema/union-base-no-discriminator.err +++ b/tests/qapi-schema/union-base-no-discriminator.err @@ -1,2 +1,2 @@ tests/qapi-schema/union-base-no-discriminator.json: In union 'TestUnion': -tests/qapi-schema/union-base-no-discriminator.json:11: Simple union 'TestUnion' must not have a base +tests/qapi-schema/union-base-no-discriminator.json:11: simple union 'TestUnion' must not have a base diff --git a/tests/qapi-schema/union-branch-case.err b/tests/qapi-schema/union-branch-case.err index 09313d7f83..f111210281 100644 --- a/tests/qapi-schema/union-branch-case.err +++ b/tests/qapi-schema/union-branch-case.err @@ -1,2 +1,2 @@ tests/qapi-schema/union-branch-case.json: In union 'Uni': -tests/qapi-schema/union-branch-case.json:2: Member of union 'Uni' uses uppercase in name 'Branch' +tests/qapi-schema/union-branch-case.json:2: member of union 'Uni' uses uppercase in name 'Branch' diff --git a/tests/qapi-schema/union-branch-invalid-dict.err b/tests/qapi-schema/union-branch-invalid-dict.err index 5b8b68432c..d11a739674 100644 --- a/tests/qapi-schema/union-branch-invalid-dict.err +++ b/tests/qapi-schema/union-branch-invalid-dict.err @@ -1,2 +1,2 @@ tests/qapi-schema/union-branch-invalid-dict.json: In union 'UnionInvalidBranch': -tests/qapi-schema/union-branch-invalid-dict.json:2: Key 'type' is missing from member 'integer' of union 'UnionInvalidBranch' +tests/qapi-schema/union-branch-invalid-dict.json:2: key 'type' is missing from member 'integer' of union 'UnionInvalidBranch' diff --git a/tests/qapi-schema/union-empty.err b/tests/qapi-schema/union-empty.err index 75f2fa9f21..522b19e7ae 100644 --- a/tests/qapi-schema/union-empty.err +++ b/tests/qapi-schema/union-empty.err @@ -1,2 +1,2 @@ tests/qapi-schema/union-empty.json: In union 'Union': -tests/qapi-schema/union-empty.json:2: Union 'Union' has no branches +tests/qapi-schema/union-empty.json:2: union 'Union' has no branches diff --git a/tests/qapi-schema/union-optional-branch.err b/tests/qapi-schema/union-optional-branch.err index 09320416ad..a5677f74bc 100644 --- a/tests/qapi-schema/union-optional-branch.err +++ b/tests/qapi-schema/union-optional-branch.err @@ -1,2 +1,2 @@ tests/qapi-schema/union-optional-branch.json: In union 'Union': -tests/qapi-schema/union-optional-branch.json:2: Member of union 'Union' does not allow optional name '*a' +tests/qapi-schema/union-optional-branch.json:2: member of union 'Union' does not allow optional name '*a' diff --git a/tests/qapi-schema/union-unknown.err b/tests/qapi-schema/union-unknown.err index 7c6cabb8cc..5d4fdd2857 100644 --- a/tests/qapi-schema/union-unknown.err +++ b/tests/qapi-schema/union-unknown.err @@ -1,2 +1,2 @@ tests/qapi-schema/union-unknown.json: In union 'Union': -tests/qapi-schema/union-unknown.json:2: Member 'unknown' of union 'Union' uses unknown type 'MissingType' +tests/qapi-schema/union-unknown.json:2: member 'unknown' of union 'Union' uses unknown type 'MissingType' diff --git a/tests/qapi-schema/unknown-escape.err b/tests/qapi-schema/unknown-escape.err index 000e30ddf3..e24bbaf046 100644 --- a/tests/qapi-schema/unknown-escape.err +++ b/tests/qapi-schema/unknown-escape.err @@ -1 +1 @@ -tests/qapi-schema/unknown-escape.json:3:21: Unknown escape \x +tests/qapi-schema/unknown-escape.json:3:21: unknown escape \x diff --git a/tests/qapi-schema/unknown-expr-key.err b/tests/qapi-schema/unknown-expr-key.err index 4340eaf894..07558edb78 100644 --- a/tests/qapi-schema/unknown-expr-key.err +++ b/tests/qapi-schema/unknown-expr-key.err @@ -1,2 +1,2 @@ -tests/qapi-schema/unknown-expr-key.json:2: Unknown keys 'bogus', 'phony' in struct 'bar' +tests/qapi-schema/unknown-expr-key.json:2: unknown keys 'bogus', 'phony' in struct 'bar' Valid keys are 'base', 'data', 'features', 'if', 'struct'. -- cgit v1.2.3-55-g7522 From fa110c6a9e6c0ae0ce2d4bcf5771cdb8c3e53a7e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 27 Sep 2019 15:46:29 +0200 Subject: qapi: Move context-sensitive checking to the proper place When we introduced the QAPISchema intermediate representation (commit ac88219a6c7), we took a shortcut: we left check_exprs() & friends alone instead of moving semantic checks into the QAPISchemaFOO.check(). The .check() assert check_exprs() did its job. Time to finish the conversion job. Move exactly the context-sensitive checks to the .check(). They replace assertions there. Context-free checks stay put. Fixes the misleading optional tag error demonstrated by test flat-union-optional-discriminator. A few other error message improve. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20190927134639.4284-17-armbru@redhat.com> --- scripts/qapi/common.py | 424 ++++++++++----------- tests/qapi-schema/alternate-any.err | 2 +- .../qapi-schema/alternate-conflict-bool-string.err | 2 +- tests/qapi-schema/alternate-conflict-dict.err | 2 +- tests/qapi-schema/alternate-conflict-enum-bool.err | 2 +- tests/qapi-schema/alternate-conflict-enum-int.err | 2 +- .../qapi-schema/alternate-conflict-num-string.err | 2 +- tests/qapi-schema/alternate-conflict-string.err | 2 +- tests/qapi-schema/alternate-nested.err | 2 +- tests/qapi-schema/alternate-unknown.err | 2 +- tests/qapi-schema/args-alternate.err | 2 +- tests/qapi-schema/args-any.err | 2 +- tests/qapi-schema/args-array-unknown.err | 2 +- tests/qapi-schema/args-boxed-string.err | 2 +- tests/qapi-schema/args-int.err | 2 +- tests/qapi-schema/args-member-unknown.err | 2 +- tests/qapi-schema/args-union.err | 2 +- tests/qapi-schema/args-unknown.err | 2 +- tests/qapi-schema/bad-base.err | 2 +- tests/qapi-schema/command-int.err | 2 +- tests/qapi-schema/flat-union-base-any.err | 2 +- tests/qapi-schema/flat-union-base-union.err | 2 +- .../flat-union-discriminator-bad-name.err | 2 +- .../flat-union-discriminator-bad-name.json | 1 - tests/qapi-schema/flat-union-empty.err | 2 +- tests/qapi-schema/flat-union-int-branch.err | 2 +- .../qapi-schema/flat-union-invalid-branch-key.err | 2 +- .../flat-union-invalid-if-discriminator.err | 2 +- .../flat-union-optional-discriminator.err | 2 +- .../flat-union-optional-discriminator.json | 1 - .../flat-union-string-discriminator.err | 2 +- tests/qapi-schema/redefined-builtin.err | 2 +- tests/qapi-schema/redefined-type.err | 2 +- tests/qapi-schema/returns-alternate.err | 2 +- tests/qapi-schema/returns-unknown.err | 2 +- tests/qapi-schema/returns-whitelist.err | 2 +- tests/qapi-schema/union-empty.err | 2 +- tests/qapi-schema/union-invalid-base.err | 2 +- tests/qapi-schema/union-unknown.err | 2 +- tests/qapi-schema/union-unknown.json | 2 +- 40 files changed, 230 insertions(+), 270 deletions(-) (limited to 'tests/qapi-schema/args-array-unknown.err') diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 9acff01d3e..f22e84c4a8 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -21,25 +21,6 @@ import string import sys from collections import OrderedDict -builtin_types = { - 'null': 'QTYPE_QNULL', - 'str': 'QTYPE_QSTRING', - 'int': 'QTYPE_QNUM', - 'number': 'QTYPE_QNUM', - 'bool': 'QTYPE_QBOOL', - 'int8': 'QTYPE_QNUM', - 'int16': 'QTYPE_QNUM', - 'int32': 'QTYPE_QNUM', - 'int64': 'QTYPE_QNUM', - 'uint8': 'QTYPE_QNUM', - 'uint16': 'QTYPE_QNUM', - 'uint32': 'QTYPE_QNUM', - 'uint64': 'QTYPE_QNUM', - 'size': 'QTYPE_QNUM', - 'any': None, # any QType possible, actually - 'QType': 'QTYPE_QSTRING', -} - # Are documentation comments required? doc_required = False @@ -49,11 +30,6 @@ returns_whitelist = [] # Whitelist of entities allowed to violate case conventions name_case_whitelist = [] -enum_types = {} -struct_types = {} -union_types = {} -all_names = {} - # # Parsing the schema into expressions @@ -671,34 +647,9 @@ class QAPISchemaParser(object): # -# Semantic analysis of schema expressions -# TODO fold into QAPISchema -# TODO catching name collisions in generated code would be nice +# Check (context-free) schema expression structure # - -def find_base_members(base): - if isinstance(base, dict): - return base - base_struct_define = struct_types.get(base) - if not base_struct_define: - return None - return base_struct_define['data'] - - -# Return the qtype of an alternate branch, or None on error. -def find_alternate_member_qtype(qapi_type): - if qapi_type in builtin_types: - return builtin_types[qapi_type] - elif qapi_type in struct_types: - return 'QTYPE_QDICT' - elif qapi_type in enum_types: - return 'QTYPE_QSTRING' - elif qapi_type in union_types: - return 'QTYPE_QDICT' - return None - - # Names must be letters, numbers, -, and _. They must start with letter, # except for downstream extensions which must start with __RFQDN_. # Dots are only valid in the downstream extension prefix. @@ -748,16 +699,6 @@ def check_defn_name_str(name, info, meta): info, "%s '%s' should not end in '%s'" % (meta, name, name[-4:])) -def add_name(name, info, meta): - global all_names - # FIXME should reject names that differ only in '_' vs. '.' - # vs. '-', because they're liable to clash in generated C. - if name in all_names: - raise QAPISemError(info, "%s '%s' is already defined" - % (all_names[name], name)) - all_names[name] = meta - - def check_if(expr, info): def check_if_str(ifcond, info): @@ -781,13 +722,11 @@ def check_if(expr, info): def check_type(value, info, source, - allow_array=False, allow_dict=False, allow_metas=[]): - global all_names - + allow_array=False, allow_dict=False): if value is None: return - # Check if array type for value is okay + # Array type if isinstance(value, list): if not allow_array: raise QAPISemError(info, "%s cannot be an array" % source) @@ -795,19 +734,14 @@ def check_type(value, info, source, raise QAPISemError(info, "%s: array type must contain single type name" % source) - check_type(value[0], info, source, allow_metas=allow_metas) return - # Check if type name for value is okay + # Type name if isinstance(value, str): - if value not in all_names: - raise QAPISemError(info, "%s uses unknown type '%s'" - % (source, value)) - if not all_names[value] in allow_metas: - raise QAPISemError(info, "%s cannot use %s type '%s'" % - (source, all_names[value], value)) return + # Anonymous type + if not allow_dict: raise QAPISemError(info, "%s should be a type name" % source) @@ -829,43 +763,28 @@ def check_type(value, info, source, check_if(arg, info) normalize_if(arg) check_type(arg['type'], info, "member '%s' of %s" % (key, source), - allow_array=True, - allow_metas=['built-in', 'union', 'alternate', 'struct', - 'enum']) + allow_array=True) def check_command(expr, info): name = expr['command'] boxed = expr.get('boxed', False) - args_meta = ['struct'] - if boxed: - args_meta += ['union'] check_type(expr.get('data'), info, "'data' for command '%s'" % name, - allow_dict=not boxed, allow_metas=args_meta) - returns_meta = ['union', 'struct'] - if name in returns_whitelist: - returns_meta += ['built-in', 'alternate', 'enum'] + allow_dict=not boxed) check_type(expr.get('returns'), info, "'returns' for command '%s'" % name, - allow_array=True, allow_metas=returns_meta) + allow_array=True) def check_event(expr, info): name = expr['event'] boxed = expr.get('boxed', False) - meta = ['struct'] - if boxed: - meta += ['union'] check_type(expr.get('data'), info, "'data' for event '%s'" % name, - allow_dict=not boxed, allow_metas=meta) - - -def enum_get_names(expr): - return [e['name'] for e in expr['data']] + allow_dict=not boxed) def check_union(expr, info): @@ -874,55 +793,18 @@ def check_union(expr, info): discriminator = expr.get('discriminator') members = expr['data'] - # Two types of unions, determined by discriminator. - - # With no discriminator it is a simple union. - if discriminator is None: - enum_values = members.keys() - allow_metas = ['built-in', 'union', 'alternate', 'struct', 'enum'] + if discriminator is None: # simple union if base is not None: raise QAPISemError( info, "simple union '%s' must not have a base" % name) - - # Else, it's a flat union. - else: - # The object must have a string or dictionary 'base'. + else: # flat union check_type(base, info, "'base' for union '%s'" % name, - allow_dict=name, allow_metas=['struct']) + allow_dict=name) if not base: raise QAPISemError( info, "flat union '%s' must have a base" % name) - base_members = find_base_members(base) - assert base_members is not None - - # The value of member 'discriminator' must name a non-optional - # member of the base struct. check_name_is_str(discriminator, info, "discriminator of flat union '%s'" % name) - check_name_str(discriminator, info, - "discriminator of flat union '%s'" % name) - discriminator_value = base_members.get(discriminator) - if not discriminator_value: - raise QAPISemError(info, - "discriminator '%s' is not a member of 'base'" - % discriminator) - if discriminator_value.get('if'): - raise QAPISemError( - info, - "the discriminator '%s' for union %s must not be conditional" - % (discriminator, name)) - enum_define = enum_types.get(discriminator_value['type']) - # Do not allow string discriminator - if not enum_define: - raise QAPISemError( - info, - "discriminator '%s' must be of enumeration type" - % discriminator) - enum_values = enum_get_names(enum_define) - allow_metas = ['struct'] - - if (len(enum_values) == 0): - raise QAPISemError(info, "union '%s' has no branches" % name) for (key, value) in members.items(): check_name_str(key, info, "member of union '%s'" % name) @@ -931,25 +813,14 @@ def check_union(expr, info): ['type'], ['if']) check_if(value, info) normalize_if(value) - # Each value must name a known type check_type(value['type'], info, "member '%s' of union '%s'" % (key, name), - allow_array=not base, allow_metas=allow_metas) - - # If the discriminator names an enum type, then all members - # of 'data' must also be members of the enum type. - if discriminator is not None: - if key not in enum_values: - raise QAPISemError( - info, - "discriminator value '%s' is not found in enum '%s'" - % (key, enum_define['enum'])) + allow_array=not base) def check_alternate(expr, info): name = expr['alternate'] members = expr['data'] - types_seen = {} if len(members) == 0: raise QAPISemError(info, @@ -961,37 +832,8 @@ def check_alternate(expr, info): ['type'], ['if']) check_if(value, info) normalize_if(value) - typ = value['type'] - - # Ensure alternates have no type conflicts. - check_type(typ, info, "member '%s' of alternate '%s'" % (key, name), - allow_metas=['built-in', 'union', 'struct', 'enum']) - qtype = find_alternate_member_qtype(typ) - if not qtype: - raise QAPISemError( - info, - "alternate '%s' member '%s' cannot use type '%s'" - % (name, key, typ)) - conflicting = set([qtype]) - if qtype == 'QTYPE_QSTRING': - enum_expr = enum_types.get(typ) - if enum_expr: - for v in enum_get_names(enum_expr): - if v in ['on', 'off']: - conflicting.add('QTYPE_QBOOL') - if re.match(r'[-+0-9.]', v): # lazy, could be tightened - conflicting.add('QTYPE_QNUM') - else: - conflicting.add('QTYPE_QNUM') - conflicting.add('QTYPE_QBOOL') - for qt in conflicting: - if qt in types_seen: - raise QAPISemError( - info, - "alternate '%s' member '%s' can't be distinguished " - "from member '%s'" - % (name, key, types_seen[qt])) - types_seen[qt] = key + check_type(value['type'], info, + "member '%s' of alternate '%s'" % (key, name)) def check_enum(expr, info): @@ -1024,8 +866,7 @@ def check_struct(expr, info): check_type(members, info, "'data' for struct '%s'" % name, allow_dict=name) - check_type(expr.get('base'), info, "'base' for struct '%s'" % name, - allow_metas=['struct']) + check_type(expr.get('base'), info, "'base' for struct '%s'" % name) if features: if not isinstance(features, list): @@ -1111,13 +952,6 @@ def normalize_if(expr): def check_exprs(exprs): - global all_names - - # Populate name table with names of built-in types - for builtin in builtin_types.keys(): - all_names[builtin] = 'built-in' - - # Learn the types and check for valid expression keys for expr_elem in exprs: expr = expr_elem['expr'] info = expr_elem['info'] @@ -1134,14 +968,12 @@ def check_exprs(exprs): meta = 'enum' check_keys(expr, info, 'enum', ['data'], ['if', 'prefix']) normalize_enum(expr) - enum_types[expr[meta]] = expr elif 'union' in expr: meta = 'union' check_keys(expr, info, 'union', ['data'], ['base', 'discriminator', 'if']) normalize_members(expr.get('base')) normalize_members(expr['data']) - union_types[expr[meta]] = expr elif 'alternate' in expr: meta = 'alternate' check_keys(expr, info, 'alternate', ['data'], ['if']) @@ -1152,7 +984,6 @@ def check_exprs(exprs): ['base', 'if', 'features']) normalize_members(expr['data']) normalize_features(expr.get('features')) - struct_types[expr[meta]] = expr elif 'command' in expr: meta = 'command' check_keys(expr, info, 'command', [], @@ -1166,36 +997,29 @@ def check_exprs(exprs): else: raise QAPISemError(info, "expression is missing metatype") normalize_if(expr) + name = expr[meta] check_name_is_str(name, info, "'%s'" % meta) info.set_defn(meta, name) check_defn_name_str(name, info, meta) - add_name(name, info, meta) + if doc and doc.symbol != name: raise QAPISemError( info, "definition of '%s' follows documentation for '%s'" % (name, doc.symbol)) - # Validate that exprs make sense - for expr_elem in exprs: - expr = expr_elem['expr'] - info = expr_elem['info'] - doc = expr_elem.get('doc') - - if 'include' in expr: - continue - if 'enum' in expr: + if meta == 'enum': check_enum(expr, info) - elif 'union' in expr: + elif meta == 'union': check_union(expr, info) - elif 'alternate' in expr: + elif meta == 'alternate': check_alternate(expr, info) - elif 'struct' in expr: + elif meta == 'struct': check_struct(expr, info) - elif 'command' in expr: + elif meta == 'command': check_command(expr, info) - elif 'event' in expr: + elif meta == 'event': check_event(expr, info) else: assert False, 'unexpected meta type' @@ -1208,9 +1032,12 @@ def check_exprs(exprs): # # Schema compiler frontend +# TODO catching name collisions in generated code would be nice # class QAPISchemaEntity(object): + meta = None + def __init__(self, name, info, doc, ifcond=None): assert name is None or isinstance(name, str) self.name = name @@ -1251,6 +1078,10 @@ class QAPISchemaEntity(object): def visit(self, visitor): assert self._checked + def describe(self): + assert self.meta + return "%s '%s'" % (self.meta, self.name) + class QAPISchemaVisitor(object): def visit_begin(self, schema): @@ -1341,8 +1172,14 @@ class QAPISchemaType(QAPISchemaEntity): return None return self.name + def describe(self): + assert self.meta + return "%s type '%s'" % (self.meta, self.name) + class QAPISchemaBuiltinType(QAPISchemaType): + meta = 'built-in' + def __init__(self, name, json_type, c_type): QAPISchemaType.__init__(self, name, None, None) assert not c_type or isinstance(c_type, str) @@ -1374,6 +1211,8 @@ class QAPISchemaBuiltinType(QAPISchemaType): class QAPISchemaEnumType(QAPISchemaType): + meta = 'enum' + def __init__(self, name, info, doc, ifcond, members, prefix): QAPISchemaType.__init__(self, name, info, doc, ifcond) for m in members: @@ -1411,6 +1250,8 @@ class QAPISchemaEnumType(QAPISchemaType): class QAPISchemaArrayType(QAPISchemaType): + meta = 'array' + def __init__(self, name, info, element_type): QAPISchemaType.__init__(self, name, info, None, None) assert isinstance(element_type, str) @@ -1419,8 +1260,9 @@ class QAPISchemaArrayType(QAPISchemaType): def check(self, schema): QAPISchemaType.check(self, schema) - self.element_type = schema.lookup_type(self._element_type_name) - assert self.element_type + self.element_type = schema.resolve_type( + self._element_type_name, self.info, + self.info and self.info.defn_meta) assert not isinstance(self.element_type, QAPISchemaArrayType) @property @@ -1453,6 +1295,10 @@ class QAPISchemaArrayType(QAPISchemaType): visitor.visit_array_type(self.name, self.info, self.ifcond, self.element_type) + def describe(self): + assert self.meta + return "%s type ['%s']" % (self.meta, self._element_type_name) + class QAPISchemaObjectType(QAPISchemaType): def __init__(self, name, info, doc, ifcond, @@ -1461,6 +1307,7 @@ class QAPISchemaObjectType(QAPISchemaType): # flat union has base, variants, and no local_members # simple union has local_members, variants, and no base QAPISchemaType.__init__(self, name, info, doc, ifcond) + self.meta = 'union' if variants else 'struct' assert base is None or isinstance(base, str) for m in local_members: assert isinstance(m, QAPISchemaObjectTypeMember) @@ -1495,8 +1342,14 @@ class QAPISchemaObjectType(QAPISchemaType): seen = OrderedDict() if self._base_name: - self.base = schema.lookup_type(self._base_name) - assert isinstance(self.base, QAPISchemaObjectType) + self.base = schema.resolve_type(self._base_name, self.info, + "'base'") + if (not isinstance(self.base, QAPISchemaObjectType) + or self.base.variants): + raise QAPISemError( + self.info, + "'base' requires a struct type, %s isn't" + % self.base.describe()) self.base.check(schema) self.base.check_clash(self.info, seen) for m in self.local_members: @@ -1508,7 +1361,6 @@ class QAPISchemaObjectType(QAPISchemaType): if self.variants: self.variants.check(schema, seen) - assert self.variants.tag_member in members self.variants.check_clash(self.info, seen) # Features are in a name space separate from members @@ -1646,8 +1498,8 @@ class QAPISchemaObjectTypeMember(QAPISchemaMember): def check(self, schema): assert self.defined_in - self.type = schema.lookup_type(self._type_name) - assert self.type + self.type = schema.resolve_type(self._type_name, self.info, + self.describe) class QAPISchemaObjectTypeVariants(object): @@ -1671,12 +1523,40 @@ class QAPISchemaObjectTypeVariants(object): v.set_defined_in(name) def check(self, schema, seen): - if not self.tag_member: # flat union - self.tag_member = seen[c_name(self._tag_name)] - assert self._tag_name == self.tag_member.name - assert isinstance(self.tag_member.type, QAPISchemaEnumType) - assert not self.tag_member.optional - assert self.tag_member.ifcond == [] + if not self.tag_member: # flat union + self.tag_member = seen.get(c_name(self._tag_name)) + base = "'base'" + # Pointing to the base type when not implicit would be + # nice, but we don't know it here + if not self.tag_member or self._tag_name != self.tag_member.name: + raise QAPISemError( + self.info, + "discriminator '%s' is not a member of %s" + % (self._tag_name, base)) + # Here we do: + base_type = schema.lookup_type(self.tag_member.defined_in) + assert base_type + if not base_type.is_implicit(): + base = "base type '%s'" % self.tag_member.defined_in + if not isinstance(self.tag_member.type, QAPISchemaEnumType): + raise QAPISemError( + self.info, + "discriminator member '%s' of %s must be of enum type" + % (self._tag_name, base)) + if self.tag_member.optional: + raise QAPISemError( + self.info, + "discriminator member '%s' of %s must not be optional" + % (self._tag_name, base)) + if self.tag_member.ifcond: + raise QAPISemError( + self.info, + "discriminator member '%s' of %s must not be conditional" + % (self._tag_name, base)) + else: # simple union + assert isinstance(self.tag_member.type, QAPISchemaEnumType) + assert not self.tag_member.optional + assert self.tag_member.ifcond == [] if self._tag_name: # flat union # branches that are not explicitly covered get an empty type cases = set([v.name for v in self.variants]) @@ -1686,15 +1566,24 @@ class QAPISchemaObjectTypeVariants(object): 'q_empty', m.ifcond) v.set_defined_in(self.tag_member.defined_in) self.variants.append(v) - assert self.variants + if not self.variants: + raise QAPISemError(self.info, "union has no branches") for v in self.variants: v.check(schema) # Union names must match enum values; alternate names are # checked separately. Use 'seen' to tell the two apart. if seen: - assert v.name in self.tag_member.type.member_names() - assert (isinstance(v.type, QAPISchemaObjectType) - and not v.type.variants) + if v.name not in self.tag_member.type.member_names(): + raise QAPISemError( + self.info, + "branch '%s' is not a value of %s" + % (v.name, self.tag_member.type.describe())) + if (not isinstance(v.type, QAPISchemaObjectType) + or v.type.variants): + raise QAPISemError( + self.info, + "%s cannot use %s" + % (v.describe(self.info), v.type.describe())) v.type.check(schema) def check_clash(self, info, seen): @@ -1713,6 +1602,8 @@ class QAPISchemaObjectTypeVariant(QAPISchemaObjectTypeMember): class QAPISchemaAlternateType(QAPISchemaType): + meta = 'alternate' + def __init__(self, name, info, doc, ifcond, variants): QAPISchemaType.__init__(self, name, info, doc, ifcond) assert isinstance(variants, QAPISchemaObjectTypeVariants) @@ -1730,9 +1621,34 @@ class QAPISchemaAlternateType(QAPISchemaType): # Alternate branch names have no relation to the tag enum values; # so we have to check for potential name collisions ourselves. seen = {} + types_seen = {} for v in self.variants.variants: v.check_clash(self.info, seen) - # TODO check conflicting qtypes + qtype = v.type.alternate_qtype() + if not qtype: + raise QAPISemError( + self.info, + "%s cannot use %s" + % (v.describe(self.info), v.type.describe())) + conflicting = set([qtype]) + if qtype == 'QTYPE_QSTRING': + if isinstance(v.type, QAPISchemaEnumType): + for m in v.type.members: + if m.name in ['on', 'off']: + conflicting.add('QTYPE_QBOOL') + if re.match(r'[-+0-9.]', m.name): + # lazy, could be tightened + conflicting.add('QTYPE_QNUM') + else: + conflicting.add('QTYPE_QNUM') + conflicting.add('QTYPE_QBOOL') + for qt in conflicting: + if qt in types_seen: + raise QAPISemError( + self.info, + "%s can't be distinguished from '%s'" + % (v.describe(self.info), types_seen[qt])) + types_seen[qt] = v.name if self.doc: self.doc.connect_member(v) if self.doc: @@ -1751,6 +1667,8 @@ class QAPISchemaAlternateType(QAPISchemaType): class QAPISchemaCommand(QAPISchemaEntity): + meta = 'command' + def __init__(self, name, info, doc, ifcond, arg_type, ret_type, gen, success_response, boxed, allow_oob, allow_preconfig): QAPISchemaEntity.__init__(self, name, info, doc, ifcond) @@ -1769,14 +1687,32 @@ class QAPISchemaCommand(QAPISchemaEntity): def check(self, schema): QAPISchemaEntity.check(self, schema) if self._arg_type_name: - self.arg_type = schema.lookup_type(self._arg_type_name) - assert isinstance(self.arg_type, QAPISchemaObjectType) - assert not self.arg_type.variants or self.boxed + self.arg_type = schema.resolve_type( + self._arg_type_name, self.info, "command's 'data'") + if not isinstance(self.arg_type, QAPISchemaObjectType): + raise QAPISemError( + self.info, + "command's 'data' cannot take %s" + % self.arg_type.describe()) + if self.arg_type.variants and not self.boxed: + raise QAPISemError( + self.info, + "command's 'data' can take %s only with 'boxed': true" + % self.arg_type.describe()) elif self.boxed: raise QAPISemError(self.info, "use of 'boxed' requires 'data'") if self._ret_type_name: - self.ret_type = schema.lookup_type(self._ret_type_name) - assert isinstance(self.ret_type, QAPISchemaType) + self.ret_type = schema.resolve_type( + self._ret_type_name, self.info, "command's 'returns'") + if self.name not in returns_whitelist: + if not (isinstance(self.ret_type, QAPISchemaObjectType) + or (isinstance(self.ret_type, QAPISchemaArrayType) + and isinstance(self.ret_type.element_type, + QAPISchemaObjectType))): + raise QAPISemError( + self.info, + "command's 'returns' cannot take %s" + % self.ret_type.describe()) def visit(self, visitor): QAPISchemaEntity.visit(self, visitor) @@ -1788,6 +1724,8 @@ class QAPISchemaCommand(QAPISchemaEntity): class QAPISchemaEvent(QAPISchemaEntity): + meta = 'event' + def __init__(self, name, info, doc, ifcond, arg_type, boxed): QAPISchemaEntity.__init__(self, name, info, doc, ifcond) assert not arg_type or isinstance(arg_type, str) @@ -1798,9 +1736,18 @@ class QAPISchemaEvent(QAPISchemaEntity): def check(self, schema): QAPISchemaEntity.check(self, schema) if self._arg_type_name: - self.arg_type = schema.lookup_type(self._arg_type_name) - assert isinstance(self.arg_type, QAPISchemaObjectType) - assert not self.arg_type.variants or self.boxed + self.arg_type = schema.resolve_type( + self._arg_type_name, self.info, "event's 'data'") + if not isinstance(self.arg_type, QAPISchemaObjectType): + raise QAPISemError( + self.info, + "event's 'data' cannot take %s" + % self.arg_type.describe()) + if self.arg_type.variants and not self.boxed: + raise QAPISemError( + self.info, + "event's 'data' can take %s only with 'boxed': true" + % self.arg_type.describe()) elif self.boxed: raise QAPISemError(self.info, "use of 'boxed' requires 'data'") @@ -1831,10 +1778,16 @@ class QAPISchema(object): def _def_entity(self, ent): # Only the predefined types are allowed to not have info assert ent.info or self._predefining - assert ent.name is None or ent.name not in self._entity_dict self._entity_list.append(ent) - if ent.name is not None: - self._entity_dict[ent.name] = ent + if ent.name is None: + return + # TODO reject names that differ only in '_' vs. '.' vs. '-', + # because they're liable to clash in generated C. + other_ent = self._entity_dict.get(ent.name) + if other_ent: + raise QAPISemError( + ent.info, "%s is already defined" % other_ent.describe()) + self._entity_dict[ent.name] = ent def lookup_entity(self, name, typ=None): ent = self._entity_dict.get(name) @@ -1845,6 +1798,15 @@ class QAPISchema(object): def lookup_type(self, name): return self.lookup_entity(name, QAPISchemaType) + def resolve_type(self, name, info, what): + typ = self.lookup_type(name) + if not typ: + if callable(what): + what = what(info) + raise QAPISemError( + info, "%s uses unknown type '%s'" % (what, name)) + return typ + def _def_include(self, expr, info, doc): include = expr['include'] assert doc is None @@ -1930,7 +1892,7 @@ class QAPISchema(object): # But it's not tight: the disjunction need not imply it. We # may end up compiling useless wrapper types. # TODO kill simple unions or implement the disjunction - assert ifcond == typ._ifcond # pylint: disable=protected-access + assert (ifcond or []) == typ._ifcond # pylint: disable=protected-access else: self._def_entity(QAPISchemaObjectType(name, info, doc, ifcond, None, members, None, [])) diff --git a/tests/qapi-schema/alternate-any.err b/tests/qapi-schema/alternate-any.err index 5314760775..03aaf29506 100644 --- a/tests/qapi-schema/alternate-any.err +++ b/tests/qapi-schema/alternate-any.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-any.json: In alternate 'Alt': -tests/qapi-schema/alternate-any.json:2: alternate 'Alt' member 'one' cannot use type 'any' +tests/qapi-schema/alternate-any.json:2: branch 'one' cannot use built-in type 'any' diff --git a/tests/qapi-schema/alternate-conflict-bool-string.err b/tests/qapi-schema/alternate-conflict-bool-string.err index e2b89f3cac..f7513b9cbe 100644 --- a/tests/qapi-schema/alternate-conflict-bool-string.err +++ b/tests/qapi-schema/alternate-conflict-bool-string.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-bool-string.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-bool-string.json:2: alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-bool-string.json:2: branch 'two' can't be distinguished from 'one' diff --git a/tests/qapi-schema/alternate-conflict-dict.err b/tests/qapi-schema/alternate-conflict-dict.err index e3f7d9072d..e5b42d04c9 100644 --- a/tests/qapi-schema/alternate-conflict-dict.err +++ b/tests/qapi-schema/alternate-conflict-dict.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-dict.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-dict.json:6: alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-dict.json:6: branch 'two' can't be distinguished from 'one' diff --git a/tests/qapi-schema/alternate-conflict-enum-bool.err b/tests/qapi-schema/alternate-conflict-enum-bool.err index d0fe1433fc..3d23aeba51 100644 --- a/tests/qapi-schema/alternate-conflict-enum-bool.err +++ b/tests/qapi-schema/alternate-conflict-enum-bool.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-enum-bool.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-enum-bool.json:4: alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-enum-bool.json:4: branch 'two' can't be distinguished from 'one' diff --git a/tests/qapi-schema/alternate-conflict-enum-int.err b/tests/qapi-schema/alternate-conflict-enum-int.err index 866428b1d1..b72768caa4 100644 --- a/tests/qapi-schema/alternate-conflict-enum-int.err +++ b/tests/qapi-schema/alternate-conflict-enum-int.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-enum-int.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-enum-int.json:4: alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-enum-int.json:4: branch 'two' can't be distinguished from 'one' diff --git a/tests/qapi-schema/alternate-conflict-num-string.err b/tests/qapi-schema/alternate-conflict-num-string.err index d00975453e..b8a2bb1829 100644 --- a/tests/qapi-schema/alternate-conflict-num-string.err +++ b/tests/qapi-schema/alternate-conflict-num-string.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-num-string.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-num-string.json:2: alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-num-string.json:2: branch 'two' can't be distinguished from 'one' diff --git a/tests/qapi-schema/alternate-conflict-string.err b/tests/qapi-schema/alternate-conflict-string.err index 0231f4fed1..3edec51911 100644 --- a/tests/qapi-schema/alternate-conflict-string.err +++ b/tests/qapi-schema/alternate-conflict-string.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-conflict-string.json: In alternate 'Alt': -tests/qapi-schema/alternate-conflict-string.json:2: alternate 'Alt' member 'two' can't be distinguished from member 'one' +tests/qapi-schema/alternate-conflict-string.json:2: branch 'two' can't be distinguished from 'one' diff --git a/tests/qapi-schema/alternate-nested.err b/tests/qapi-schema/alternate-nested.err index 03fb9fb212..cd7a076ce5 100644 --- a/tests/qapi-schema/alternate-nested.err +++ b/tests/qapi-schema/alternate-nested.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-nested.json: In alternate 'Alt2': -tests/qapi-schema/alternate-nested.json:4: member 'nested' of alternate 'Alt2' cannot use alternate type 'Alt1' +tests/qapi-schema/alternate-nested.json:4: branch 'nested' cannot use alternate type 'Alt1' diff --git a/tests/qapi-schema/alternate-unknown.err b/tests/qapi-schema/alternate-unknown.err index 7a533b2b74..df05860bba 100644 --- a/tests/qapi-schema/alternate-unknown.err +++ b/tests/qapi-schema/alternate-unknown.err @@ -1,2 +1,2 @@ tests/qapi-schema/alternate-unknown.json: In alternate 'Alt': -tests/qapi-schema/alternate-unknown.json:2: member 'unknown' of alternate 'Alt' uses unknown type 'MissingType' +tests/qapi-schema/alternate-unknown.json:2: branch 'unknown' uses unknown type 'MissingType' diff --git a/tests/qapi-schema/args-alternate.err b/tests/qapi-schema/args-alternate.err index 915f5d463b..852b81b89c 100644 --- a/tests/qapi-schema/args-alternate.err +++ b/tests/qapi-schema/args-alternate.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-alternate.json: In command 'oops': -tests/qapi-schema/args-alternate.json:3: 'data' for command 'oops' cannot use alternate type 'Alt' +tests/qapi-schema/args-alternate.json:3: command's 'data' cannot take alternate type 'Alt' diff --git a/tests/qapi-schema/args-any.err b/tests/qapi-schema/args-any.err index 8c4f9aeef4..04e11df29f 100644 --- a/tests/qapi-schema/args-any.err +++ b/tests/qapi-schema/args-any.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-any.json: In command 'oops': -tests/qapi-schema/args-any.json:2: 'data' for command 'oops' cannot use built-in type 'any' +tests/qapi-schema/args-any.json:2: command's 'data' cannot take built-in type 'any' diff --git a/tests/qapi-schema/args-array-unknown.err b/tests/qapi-schema/args-array-unknown.err index 57b0d8972e..218fc4bf9a 100644 --- a/tests/qapi-schema/args-array-unknown.err +++ b/tests/qapi-schema/args-array-unknown.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-array-unknown.json: In command 'oops': -tests/qapi-schema/args-array-unknown.json:2: member 'array' of 'data' for command 'oops' uses unknown type 'NoSuchType' +tests/qapi-schema/args-array-unknown.json:2: command uses unknown type 'NoSuchType' diff --git a/tests/qapi-schema/args-boxed-string.err b/tests/qapi-schema/args-boxed-string.err index f284406f0f..dc2b00f217 100644 --- a/tests/qapi-schema/args-boxed-string.err +++ b/tests/qapi-schema/args-boxed-string.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-boxed-string.json: In command 'foo': -tests/qapi-schema/args-boxed-string.json:2: 'data' for command 'foo' cannot use built-in type 'str' +tests/qapi-schema/args-boxed-string.json:2: command's 'data' cannot take built-in type 'str' diff --git a/tests/qapi-schema/args-int.err b/tests/qapi-schema/args-int.err index 419268186e..81b6f86b66 100644 --- a/tests/qapi-schema/args-int.err +++ b/tests/qapi-schema/args-int.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-int.json: In command 'oops': -tests/qapi-schema/args-int.json:2: 'data' for command 'oops' cannot use built-in type 'int' +tests/qapi-schema/args-int.json:2: command's 'data' cannot take built-in type 'int' diff --git a/tests/qapi-schema/args-member-unknown.err b/tests/qapi-schema/args-member-unknown.err index 168e24a4b8..0626e1209d 100644 --- a/tests/qapi-schema/args-member-unknown.err +++ b/tests/qapi-schema/args-member-unknown.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-member-unknown.json: In command 'oops': -tests/qapi-schema/args-member-unknown.json:2: member 'member' of 'data' for command 'oops' uses unknown type 'NoSuchType' +tests/qapi-schema/args-member-unknown.json:2: parameter 'member' uses unknown type 'NoSuchType' diff --git a/tests/qapi-schema/args-union.err b/tests/qapi-schema/args-union.err index 30a1534b4c..3a77b2863f 100644 --- a/tests/qapi-schema/args-union.err +++ b/tests/qapi-schema/args-union.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-union.json: In command 'oops': -tests/qapi-schema/args-union.json:3: 'data' for command 'oops' cannot use union type 'Uni' +tests/qapi-schema/args-union.json:3: command's 'data' can take union type 'Uni' only with 'boxed': true diff --git a/tests/qapi-schema/args-unknown.err b/tests/qapi-schema/args-unknown.err index cb835d7489..6857d6bf48 100644 --- a/tests/qapi-schema/args-unknown.err +++ b/tests/qapi-schema/args-unknown.err @@ -1,2 +1,2 @@ tests/qapi-schema/args-unknown.json: In command 'oops': -tests/qapi-schema/args-unknown.json:2: 'data' for command 'oops' uses unknown type 'NoSuchType' +tests/qapi-schema/args-unknown.json:2: command's 'data' uses unknown type 'NoSuchType' diff --git a/tests/qapi-schema/bad-base.err b/tests/qapi-schema/bad-base.err index fdfd288f5c..039678a364 100644 --- a/tests/qapi-schema/bad-base.err +++ b/tests/qapi-schema/bad-base.err @@ -1,2 +1,2 @@ tests/qapi-schema/bad-base.json: In struct 'MyType': -tests/qapi-schema/bad-base.json:3: 'base' for struct 'MyType' cannot use union type 'Union' +tests/qapi-schema/bad-base.json:3: 'base' requires a struct type, union type 'Union' isn't diff --git a/tests/qapi-schema/command-int.err b/tests/qapi-schema/command-int.err index 56b45bf656..3523d50a79 100644 --- a/tests/qapi-schema/command-int.err +++ b/tests/qapi-schema/command-int.err @@ -1,2 +1,2 @@ tests/qapi-schema/command-int.json: In command 'int': -tests/qapi-schema/command-int.json:2: built-in 'int' is already defined +tests/qapi-schema/command-int.json:2: built-in type 'int' is already defined diff --git a/tests/qapi-schema/flat-union-base-any.err b/tests/qapi-schema/flat-union-base-any.err index 039b9a68b9..7ab3402396 100644 --- a/tests/qapi-schema/flat-union-base-any.err +++ b/tests/qapi-schema/flat-union-base-any.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-base-any.json: In union 'TestUnion': -tests/qapi-schema/flat-union-base-any.json:8: 'base' for union 'TestUnion' cannot use built-in type 'any' +tests/qapi-schema/flat-union-base-any.json:8: 'base' requires a struct type, built-in type 'any' isn't diff --git a/tests/qapi-schema/flat-union-base-union.err b/tests/qapi-schema/flat-union-base-union.err index 93ab91378f..5db7b1e404 100644 --- a/tests/qapi-schema/flat-union-base-union.err +++ b/tests/qapi-schema/flat-union-base-union.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-base-union.json: In union 'TestUnion': -tests/qapi-schema/flat-union-base-union.json:14: 'base' for union 'TestUnion' cannot use union type 'UnionBase' +tests/qapi-schema/flat-union-base-union.json:14: 'base' requires a struct type, union type 'UnionBase' isn't diff --git a/tests/qapi-schema/flat-union-discriminator-bad-name.err b/tests/qapi-schema/flat-union-discriminator-bad-name.err index 44e41883b1..2a0deb6a0e 100644 --- a/tests/qapi-schema/flat-union-discriminator-bad-name.err +++ b/tests/qapi-schema/flat-union-discriminator-bad-name.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-discriminator-bad-name.json: In union 'MyUnion': -tests/qapi-schema/flat-union-discriminator-bad-name.json:7: discriminator of flat union 'MyUnion' uses invalid name '*switch' +tests/qapi-schema/flat-union-discriminator-bad-name.json:6: discriminator '*switch' is not a member of 'base' diff --git a/tests/qapi-schema/flat-union-discriminator-bad-name.json b/tests/qapi-schema/flat-union-discriminator-bad-name.json index ea84b75cac..3ae8c06a89 100644 --- a/tests/qapi-schema/flat-union-discriminator-bad-name.json +++ b/tests/qapi-schema/flat-union-discriminator-bad-name.json @@ -1,5 +1,4 @@ # discriminator '*switch' isn't a member of base, 'switch' is -# reports "uses invalid name", which is good enough { 'enum': 'Enum', 'data': [ 'one', 'two' ] } { 'struct': 'Base', 'data': { '*switch': 'Enum' } } diff --git a/tests/qapi-schema/flat-union-empty.err b/tests/qapi-schema/flat-union-empty.err index 96fe46b918..91a5b57f5d 100644 --- a/tests/qapi-schema/flat-union-empty.err +++ b/tests/qapi-schema/flat-union-empty.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-empty.json: In union 'Union': -tests/qapi-schema/flat-union-empty.json:4: union 'Union' has no branches +tests/qapi-schema/flat-union-empty.json:4: union has no branches diff --git a/tests/qapi-schema/flat-union-int-branch.err b/tests/qapi-schema/flat-union-int-branch.err index 2bbb8bf22e..416b696c8f 100644 --- a/tests/qapi-schema/flat-union-int-branch.err +++ b/tests/qapi-schema/flat-union-int-branch.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-int-branch.json: In union 'TestUnion': -tests/qapi-schema/flat-union-int-branch.json:8: member 'value1' of union 'TestUnion' cannot use built-in type 'int' +tests/qapi-schema/flat-union-int-branch.json:8: branch 'value1' cannot use built-in type 'int' diff --git a/tests/qapi-schema/flat-union-invalid-branch-key.err b/tests/qapi-schema/flat-union-invalid-branch-key.err index da4377be69..6997b3387d 100644 --- a/tests/qapi-schema/flat-union-invalid-branch-key.err +++ b/tests/qapi-schema/flat-union-invalid-branch-key.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-invalid-branch-key.json: In union 'TestUnion': -tests/qapi-schema/flat-union-invalid-branch-key.json:13: discriminator value 'value_wrong' is not found in enum 'TestEnum' +tests/qapi-schema/flat-union-invalid-branch-key.json:13: branch 'value_wrong' is not a value of enum type 'TestEnum' diff --git a/tests/qapi-schema/flat-union-invalid-if-discriminator.err b/tests/qapi-schema/flat-union-invalid-if-discriminator.err index be770d6baa..d2b35be9ae 100644 --- a/tests/qapi-schema/flat-union-invalid-if-discriminator.err +++ b/tests/qapi-schema/flat-union-invalid-if-discriminator.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-invalid-if-discriminator.json: In union 'TestUnion': -tests/qapi-schema/flat-union-invalid-if-discriminator.json:10: the discriminator 'enum1' for union TestUnion must not be conditional +tests/qapi-schema/flat-union-invalid-if-discriminator.json:10: discriminator member 'enum1' of 'base' must not be conditional diff --git a/tests/qapi-schema/flat-union-optional-discriminator.err b/tests/qapi-schema/flat-union-optional-discriminator.err index 536ac775e2..49fbf5b04d 100644 --- a/tests/qapi-schema/flat-union-optional-discriminator.err +++ b/tests/qapi-schema/flat-union-optional-discriminator.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-optional-discriminator.json: In union 'MyUnion': -tests/qapi-schema/flat-union-optional-discriminator.json:7: discriminator 'switch' is not a member of 'base' +tests/qapi-schema/flat-union-optional-discriminator.json:6: discriminator member 'switch' of base type 'Base' must not be optional diff --git a/tests/qapi-schema/flat-union-optional-discriminator.json b/tests/qapi-schema/flat-union-optional-discriminator.json index 143ab23a0d..2e7f766f60 100644 --- a/tests/qapi-schema/flat-union-optional-discriminator.json +++ b/tests/qapi-schema/flat-union-optional-discriminator.json @@ -1,5 +1,4 @@ # we require the discriminator to be non-optional -# FIXME reports "discriminator 'switch' is not a member of base struct 'Base'" { 'enum': 'Enum', 'data': [ 'one', 'two' ] } { 'struct': 'Base', 'data': { '*switch': 'Enum' } } diff --git a/tests/qapi-schema/flat-union-string-discriminator.err b/tests/qapi-schema/flat-union-string-discriminator.err index f5635a5774..fb499188aa 100644 --- a/tests/qapi-schema/flat-union-string-discriminator.err +++ b/tests/qapi-schema/flat-union-string-discriminator.err @@ -1,2 +1,2 @@ tests/qapi-schema/flat-union-string-discriminator.json: In union 'TestUnion': -tests/qapi-schema/flat-union-string-discriminator.json:13: discriminator 'kind' must be of enumeration type +tests/qapi-schema/flat-union-string-discriminator.json:13: discriminator member 'kind' of base type 'TestBase' must be of enum type diff --git a/tests/qapi-schema/redefined-builtin.err b/tests/qapi-schema/redefined-builtin.err index 67775fdb41..47c8933759 100644 --- a/tests/qapi-schema/redefined-builtin.err +++ b/tests/qapi-schema/redefined-builtin.err @@ -1,2 +1,2 @@ tests/qapi-schema/redefined-builtin.json: In struct 'size': -tests/qapi-schema/redefined-builtin.json:2: built-in 'size' is already defined +tests/qapi-schema/redefined-builtin.json:2: built-in type 'size' is already defined diff --git a/tests/qapi-schema/redefined-type.err b/tests/qapi-schema/redefined-type.err index 89acc82c2d..39f51c14ea 100644 --- a/tests/qapi-schema/redefined-type.err +++ b/tests/qapi-schema/redefined-type.err @@ -1,2 +1,2 @@ tests/qapi-schema/redefined-type.json: In enum 'foo': -tests/qapi-schema/redefined-type.json:3: struct 'foo' is already defined +tests/qapi-schema/redefined-type.json:3: struct type 'foo' is already defined diff --git a/tests/qapi-schema/returns-alternate.err b/tests/qapi-schema/returns-alternate.err index b98cf84cef..c1caf98c47 100644 --- a/tests/qapi-schema/returns-alternate.err +++ b/tests/qapi-schema/returns-alternate.err @@ -1,2 +1,2 @@ tests/qapi-schema/returns-alternate.json: In command 'oops': -tests/qapi-schema/returns-alternate.json:3: 'returns' for command 'oops' cannot use alternate type 'Alt' +tests/qapi-schema/returns-alternate.json:3: command's 'returns' cannot take alternate type 'Alt' diff --git a/tests/qapi-schema/returns-unknown.err b/tests/qapi-schema/returns-unknown.err index cbece00bd2..f0a989a175 100644 --- a/tests/qapi-schema/returns-unknown.err +++ b/tests/qapi-schema/returns-unknown.err @@ -1,2 +1,2 @@ tests/qapi-schema/returns-unknown.json: In command 'oops': -tests/qapi-schema/returns-unknown.json:2: 'returns' for command 'oops' uses unknown type 'NoSuchType' +tests/qapi-schema/returns-unknown.json:2: command's 'returns' uses unknown type 'NoSuchType' diff --git a/tests/qapi-schema/returns-whitelist.err b/tests/qapi-schema/returns-whitelist.err index 1ccd7d8de2..5b0285220f 100644 --- a/tests/qapi-schema/returns-whitelist.err +++ b/tests/qapi-schema/returns-whitelist.err @@ -1,2 +1,2 @@ tests/qapi-schema/returns-whitelist.json: In command 'no-way-this-will-get-whitelisted': -tests/qapi-schema/returns-whitelist.json:14: 'returns' for command 'no-way-this-will-get-whitelisted' cannot use built-in type 'int' +tests/qapi-schema/returns-whitelist.json:14: command's 'returns' cannot take array type ['int'] diff --git a/tests/qapi-schema/union-empty.err b/tests/qapi-schema/union-empty.err index 522b19e7ae..35c0d62eb0 100644 --- a/tests/qapi-schema/union-empty.err +++ b/tests/qapi-schema/union-empty.err @@ -1,2 +1,2 @@ tests/qapi-schema/union-empty.json: In union 'Union': -tests/qapi-schema/union-empty.json:2: union 'Union' has no branches +tests/qapi-schema/union-empty.json:2: union has no branches diff --git a/tests/qapi-schema/union-invalid-base.err b/tests/qapi-schema/union-invalid-base.err index be908709d2..10fecf0b56 100644 --- a/tests/qapi-schema/union-invalid-base.err +++ b/tests/qapi-schema/union-invalid-base.err @@ -1,2 +1,2 @@ tests/qapi-schema/union-invalid-base.json: In union 'TestUnion': -tests/qapi-schema/union-invalid-base.json:8: 'base' for union 'TestUnion' cannot use built-in type 'int' +tests/qapi-schema/union-invalid-base.json:8: 'base' requires a struct type, built-in type 'int' isn't diff --git a/tests/qapi-schema/union-unknown.err b/tests/qapi-schema/union-unknown.err index 5d4fdd2857..a7f340ddca 100644 --- a/tests/qapi-schema/union-unknown.err +++ b/tests/qapi-schema/union-unknown.err @@ -1,2 +1,2 @@ tests/qapi-schema/union-unknown.json: In union 'Union': -tests/qapi-schema/union-unknown.json:2: member 'unknown' of union 'Union' uses unknown type 'MissingType' +tests/qapi-schema/union-unknown.json:2: union uses unknown type 'MissingType' diff --git a/tests/qapi-schema/union-unknown.json b/tests/qapi-schema/union-unknown.json index aa7e8143d8..64d3666176 100644 --- a/tests/qapi-schema/union-unknown.json +++ b/tests/qapi-schema/union-unknown.json @@ -1,3 +1,3 @@ # we reject a union with unknown type in branch { 'union': 'Union', - 'data': { 'unknown': 'MissingType' } } + 'data': { 'unknown': ['MissingType'] } } -- cgit v1.2.3-55-g7522