Skip to content

use cue to vet another cue file #2211

Answered by mpvl
sahroshan asked this question in Q&A
Jan 11, 2023 · 2 comments · 6 replies
Discussion options

You must be logged in to vote

This is a bug, really. Two .cue files without a package clause should be considered as separate files, and thus the embedded definition should close it and this should work. We know where the problem is but haven't fixed it yet.

A workaround for now is to make schema.cue a separate package and use it as such:

! exec cue vet :schema sub.cue
cmp stderr expect-stderr
-- schema.cue --
package schema
#Config: {
	foo: {
			bar: string | *"default from schema"
	}
}
#Config

-- sub.cue --
extra: "this extra field"

-- expect-stderr --
extra: field not allowed:
    ./schema.cue:1:1
    ./schema.cue:2:10
    ./schema.cue:7:1
    ./sub.cue:1:1

Because of the same bug, it currently doesn't work to use

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@verdverm
Comment options

@sahroshan
Comment options

@verdverm
Comment options

@mpvl
Comment options

@sahroshan
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by sahroshan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants