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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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> --- tests/qapi-schema/alternate-base.err | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/qapi-schema/alternate-base.err') 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'. -- cgit v1.2.3 From 3f58cc29a8d2f01dc498ff4624a25e72448059a1 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 27 Sep 2019 15:46:33 +0200 Subject: qapi: Improve reporting of missing / unknown definition keys Have check_exprs() call check_keys() later, so its error messages gain an "in definition" line. Both check_keys() and check_name_is_str() check the definition's name is a string. Since check_keys() now runs after check_name_is_str() rather than before, its check is dead. Bury it. Checking values in check_keys() is unclean anyway. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20190927134639.4284-21-armbru@redhat.com> --- tests/qapi-schema/alternate-base.err | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/qapi-schema/alternate-base.err') diff --git a/tests/qapi-schema/alternate-base.err b/tests/qapi-schema/alternate-base.err index 4c9158db02..6290665ac2 100644 --- a/tests/qapi-schema/alternate-base.err +++ b/tests/qapi-schema/alternate-base.err @@ -1,2 +1,3 @@ +tests/qapi-schema/alternate-base.json: In alternate 'Alt': tests/qapi-schema/alternate-base.json:4: unknown key 'base' in alternate 'Alt' Valid keys are 'alternate', 'data', 'if'. -- cgit v1.2.3 From eeb57c85da04b0c120562b25e3eac5cb16d8bf15 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 27 Sep 2019 15:46:34 +0200 Subject: qapi: Avoid redundant definition references in error messages Many error messages refer to the offending definition even though they're preceded by an "in definition" line. Rephrase them. Signed-off-by: Markus Armbruster Message-Id: <20190927134639.4284-22-armbru@redhat.com> Reviewed-by: Eric Blake --- tests/qapi-schema/alternate-base.err | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/qapi-schema/alternate-base.err') diff --git a/tests/qapi-schema/alternate-base.err b/tests/qapi-schema/alternate-base.err index 6290665ac2..04cea97e5c 100644 --- a/tests/qapi-schema/alternate-base.err +++ b/tests/qapi-schema/alternate-base.err @@ -1,3 +1,3 @@ tests/qapi-schema/alternate-base.json: In alternate 'Alt': -tests/qapi-schema/alternate-base.json:4: unknown key 'base' in alternate 'Alt' +tests/qapi-schema/alternate-base.json:4: alternate has unknown key 'base' Valid keys are 'alternate', 'data', 'if'. -- cgit v1.2.3