Skip to content

Commit

Permalink
cue: move more labels and values to end of error message
Browse files Browse the repository at this point in the history
Fixes #963

Change-Id: I3fc9fde1a3649f743d534cf7593c2cfcfd8ed3f7
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9761
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
  • Loading branch information
mpvl committed May 11, 2021
1 parent 7180c7d commit dd188a6
Show file tree
Hide file tree
Showing 28 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion cmd/cue/cmd/testdata/script/export_err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cmp stdout expect-stdout
cmp stderr expect-stderr
-- expect-stderr --
a.b.2.c: incomplete value int
out: invalid interpolation: undefined field d:
out: invalid interpolation: undefined field: d:
./exporterr/export_err.cue:7:6
./exporterr/export_err.cue:7:16
-- expect-stdout --
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/basicrewrite/012_selecting.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ Result:
// ./in.cue:4:16
}
f: (_|_){
// [incomplete] f: undefined field b:
// [incomplete] f: undefined field: b:
// ./in.cue:5:16
}
g: (_|_){
// [incomplete] g: undefined field b:
// [incomplete] g: undefined field: b:
// ./in.cue:6:16
}
h: (_|_){
Expand Down
6 changes: 3 additions & 3 deletions cue/testdata/builtins/all.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Errors:
fatalArg.x: invalid operands "eee" and 'eee' to '+' (type string and bytes):
./in.cue:3:12
./in.cue:3:20
0.a: undefined field c:
0.a: undefined field: c:
./in.cue:9:20

Result:
Expand All @@ -42,7 +42,7 @@ Result:
#b: (#struct){
}
x: (_|_){
// [eval] 0.a: undefined field c:
// [eval] 0.a: undefined field: c:
// ./in.cue:9:20
}
}
Expand All @@ -51,7 +51,7 @@ Result:
}
x: (struct){
a: (_|_){
// [incomplete] okIncompleteChild.x.a: undefined field c:
// [incomplete] okIncompleteChild.x.a: undefined field: c:
// ./in.cue:17:19
}
b: (int){ 1 }
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/builtins/incomplete.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Result:
}
}
_Sub: (_|_){
// [incomplete] list1._Sub: undefined field b:
// [incomplete] list1._Sub: undefined field: b:
// ./in.cue:19:13
}
a: (struct){
Expand All @@ -150,7 +150,7 @@ Result:
// ./in.cue:30:21
}
#Sub: (_|_){
// [incomplete] list2.#Sub: undefined field b:
// [incomplete] list2.#Sub: undefined field: b:
// ./in.cue:33:13
}
a: (struct){
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/comprehensions/iferror.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ Result:
// ./in.cue:10:2
}
incomplete: (_|_){
// [incomplete] incomplete: undefined field d:
// [incomplete] incomplete: undefined field: d:
// ./in.cue:16:7
// incomplete: undefined field d:
// incomplete: undefined field: d:
// ./in.cue:23:21
list: (#list){
0: (int){ 1 }
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/comprehensions/incomplete.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ c: { for x in top {} }
}
top: (_){ _ }
a: (_|_){
// [incomplete] a: incomplete bool value 'bool'
// [incomplete] a: incomplete bool: bool
}
b: (_|_){
// [incomplete] b: undefined field foo:
// [incomplete] b: undefined field: foo:
// ./in.cue:5:19
}
c: (_|_){
Expand Down
18 changes: 9 additions & 9 deletions cue/testdata/comprehensions/issue837.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ _params.hsize.$_instances: conflicting values >=0 and {$_instances:(>=0|*1)} (mi
./in.cue:35:13
./in.cue:54:12
./in.cue:55:15
#DoDeploy._params.manifest.description.service.description: undefined field service:
#DoDeploy._params.manifest.description.service.description: undefined field: service:
./in.cue:5:28
_params.hsize.$_instances: 2 errors in empty disjunction::
./in.cue:33:20
#RelabelService.out.labstr: undefined field label:
#RelabelService.out.labstr: undefined field: label:
./in.cue:50:14

Result:
Expand All @@ -94,7 +94,7 @@ Result:
kind: (string){ "service" }
}
description: (_|_){
// [incomplete] #DeploymentManifest.description.service.description: undefined field service:
// [incomplete] #DeploymentManifest.description.service.description: undefined field: service:
// ./in.cue:5:28
}
}
Expand Down Expand Up @@ -122,7 +122,7 @@ Result:
kind: (string){ "service" }
}
description: (_|_){
// [incomplete] #KumoriKinds.deployment.service.description: undefined field service:
// [incomplete] #KumoriKinds.deployment.service.description: undefined field: service:
// ./in.cue:5:28
}
}
Expand All @@ -143,7 +143,7 @@ Result:
kind: (string){ "service" }
}
description: (_|_){
// [eval] #DoDeploy._params.manifest.description.service.description: undefined field service:
// [eval] #DoDeploy._params.manifest.description.service.description: undefined field: service:
// ./in.cue:5:28
}
}
Expand All @@ -157,7 +157,7 @@ Result:
description: (_|_){
// [eval]
service: (_|_){
// [eval] #DoDeploy._params.manifest.description.service.description: undefined field service:
// [eval] #DoDeploy._params.manifest.description.service.description: undefined field: service:
// ./in.cue:5:28
}
}
Expand Down Expand Up @@ -200,7 +200,7 @@ Result:
out: (_|_){
// [eval]
labstr: (_|_){
// [eval] #RelabelService.out.labstr: undefined field label:
// [eval] #RelabelService.out.labstr: undefined field: label:
// ./in.cue:50:14
}
}
Expand All @@ -214,7 +214,7 @@ Result:
kind: (string){ "service" }
}
description: (_|_){
// [incomplete] #Deployment.service.description: undefined field service:
// [incomplete] #Deployment.service.description: undefined field: service:
// ./in.cue:5:28
}
}
Expand All @@ -226,7 +226,7 @@ Result:
kind: (string){ "service" }
}
description: (_|_){
// [incomplete] #ServiceManifest.description: undefined field service:
// [incomplete] #ServiceManifest.description: undefined field: service:
// ./in.cue:5:28
}
}
Expand Down
2 changes: 1 addition & 1 deletion cue/testdata/comprehensions/nested.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ for k, v in deployment {
}
}
selector: (_|_){
// [incomplete] service."node-exporter".spec.selector: undefined field metadata:
// [incomplete] service."node-exporter".spec.selector: undefined field: metadata:
// ./in.cue:47:35
}
}
Expand Down
6 changes: 3 additions & 3 deletions cue/testdata/cycle/compbottomnofinal.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ Result:
port: (string){ "" }
}
#Y: (_|_){
// [incomplete] small.p2.#Y: undefined field port:
// [incomplete] small.p2.#Y: undefined field: port:
// ./in.cue:50:50
port: (string){ "" }
}
Expand Down Expand Up @@ -482,7 +482,7 @@ Result:
port: (string){ "" }
}
#Y: (_|_){
// [incomplete] medium.p5.#Y: undefined field port:
// [incomplete] medium.p5.#Y: undefined field: port:
// ./in.cue:158:56
port: (string){ "" }
}
Expand All @@ -496,7 +496,7 @@ Result:
Y: (struct){
}
#Y: (_|_){
// [incomplete] medium.p6.#Y: undefined field port:
// [incomplete] medium.p6.#Y: undefined field: port:
// ./in.cue:186:56
port: (string){ "" }
}
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/definitions/comprehensions.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ issue595: {
}
-- out/eval --
Errors:
issue595.files: undefined field nam:
issue595.files: undefined field: nam:
./in.cue:8:20

Result:
Expand All @@ -25,7 +25,7 @@ Result:
}
}
files: (_|_){
// [eval] issue595.files: undefined field nam:
// [eval] issue595.files: undefined field: nam:
// ./in.cue:8:20
}
}
Expand Down
6 changes: 3 additions & 3 deletions cue/testdata/disjunctions/incomplete.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ issue782: {
name: (string){ "Hello" }
}
y: (_|_){
// [incomplete] lookup.y: undefined field a:
// [incomplete] lookup.y: undefined field: a:
// ./in.cue:13:10
}
ok1: (struct){
Expand All @@ -84,12 +84,12 @@ issue782: {
}
allFail1: (_|_){
// [incomplete] lookup.allFail1: 1 errors in empty disjunction:
// lookup.allFail1: undefined field a:
// lookup.allFail1: undefined field: a:
// ./in.cue:20:18
}
allFail2: (_|_){
// [incomplete] lookup.allFail2: 1 errors in empty disjunction:
// lookup.allFail2: undefined field a:
// lookup.allFail2: undefined field: a:
// ./in.cue:21:18
}
}
Expand Down
6 changes: 3 additions & 3 deletions cue/testdata/export/006.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ e: a.t[2:3]
}
b: (float){ 2.0 }
c: (_|_){
// [incomplete] c: undefined field c:
// [incomplete] c: undefined field: c:
// ./in.cue:1:38
}
d: (_|_){
// [incomplete] d: undefined field d:
// [incomplete] d: undefined field: d:
// ./in.cue:1:46
}
e: (_|_){
// [incomplete] e: undefined field t:
// [incomplete] e: undefined field: t:
// ./in.cue:1:57
}
}
12 changes: 6 additions & 6 deletions cue/testdata/export/007.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ e: _|_ // undefined field "t"
}
-- out/eval --
Errors:
c: undefined field c:
c: undefined field: c:
./in.cue:4:9
d: undefined field d:
d: undefined field: d:
./in.cue:5:9
e: undefined field t:
e: undefined field: t:
./in.cue:6:9

Result:
Expand All @@ -47,15 +47,15 @@ Result:
}
b: (float){ 2.0 }
c: (_|_){
// [eval] c: undefined field c:
// [eval] c: undefined field: c:
// ./in.cue:4:9
}
d: (_|_){
// [eval] d: undefined field d:
// [eval] d: undefined field: d:
// ./in.cue:5:9
}
e: (_|_){
// [eval] e: undefined field t:
// [eval] e: undefined field: t:
// ./in.cue:6:9
}
}
2 changes: 1 addition & 1 deletion cue/testdata/export/issue854.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ package c
-- out/eval --
(struct){
theb: (_|_){
// [incomplete] b: undefined field c:
// [incomplete] b: undefined field: c:
// ./b/b.cue:5:6
}
}
8 changes: 4 additions & 4 deletions cue/testdata/fulleval/029_Issue_#94.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ index: {
}
select: (struct){
opt: (_|_){
// [incomplete] select.opt: cannot reference optional field opt:
// [incomplete] select.opt: cannot reference optional field: opt:
// ./in.cue:10:15
}
txt: (int){ 2 }
Expand All @@ -107,17 +107,17 @@ index: {
}
index: (struct){
opt: (_|_){
// [incomplete] index.opt: cannot reference optional field opt:
// [incomplete] index.opt: cannot reference optional field: opt:
// ./in.cue:17:15
}
txt: (int){ 2 }
#def: (_|_){
// [incomplete] index.#def: undefined field "#def":
// [incomplete] index.#def: undefined field: "#def":
// ./in.cue:19:15
}
regular: (int){ 4 }
_hidden: (_|_){
// [incomplete] index._hidden: undefined field "_hidden":
// [incomplete] index._hidden: undefined field: "_hidden":
// ./in.cue:21:15
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ y: _|_ // field "c" not allowed in closed struct
-- out/eval --
(struct){
#a: (_|_){
// [incomplete] #a: incomplete bool value 'bool'
// [incomplete] #a: incomplete bool: bool
b: (bool){ bool }
}
x: (#struct){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ b: json.Marshal(foo)
foo: (struct){
a: (int){ 3 }
b: (_|_){
// [incomplete] foo.b: undefined field c:
// [incomplete] foo.b: undefined field: c:
// ./in.cue:5:20
}
}
b: (_|_){
// [incomplete] foo.b: undefined field c:
// [incomplete] foo.b: undefined field: c:
// ./in.cue:5:20
}
}
Expand Down

0 comments on commit dd188a6

Please sign in to comment.