Tags: cue-lang/cue
Tags
cue/errors: add package example Handling multiple errors from evaluating CUE isn't trivial, so add an example showing the various options which may be useful. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: I3aa17a141719cf02066477ef313caf92253130ce Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1203073 Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Paul Jolly <paul@myitcv.io> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
internal/cueversion: update LanguageVersion for v0.10.1 Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: Id0399520f5b7debdfaefaf5707f4d06a683faeb4 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202888 Reviewed-by: Roger Peppe <rogpeppe@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
internal/ci: bump Go and goreleaser for alpha.3 Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: If0fe3ccabeced7b5e84b5f299b9d5f6617d3f6eb Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202062 Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Roger Peppe <rogpeppe@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
cmd/cue: fix `cue help cmd mycmd ./mypkg` Jonathan Matthews correctly pointed out that a tutorial used the command successfully up to and including CUE v0.8.0, but it broke from v0.9.0. My refactor at https://cuelang.org/cl/1194247 was overall good, but it did break this edge case, which in my defense had no tests. Add tests, and fix the code. The issue was that we left args as ["cmd", "mycmd", "./mypkg"], where the valid command is only ["cmd", "mycmd"], so we treated this scenario as an unknown subcommand. Fixes #3462. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: I2208fa8411f1122ede863b8dc6a5d81805562f30 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201709 Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
internal/core/adt: add tests for validator dedupping Issue #3418 Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com> Change-Id: Id499a84ed80f18eb5ec8efdc0b2cda1a54c07188 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200736 Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Roger Peppe <rogpeppe@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
internal/cueversion: bump for v0.11 As master will now begin development for CUE v0.11.x. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: Idbfc9f5e706ea0e4ee24108b1c5f340f3c815883 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199521 Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
internal/ci: don't pin CUE v0.5 to import the github-workflow jsonschema It seems like this repository, as well as many others like cuelang.org, used the default in _cueCmd, as they did not supply the cue_cmd tag. It also seems like we never noticed for over 18 months because `cue import` and particularly our encoding/jsonschema package have not changed significantly between v0.5 and now. I noticed as I was trying to debug why cuelang.org's `go generate` for internal/ci, which is copied from cue's, did not work consistently. Now that Roger has implemented many improvements to jsonschema for the v0.10 release, and particularly as we will fix even more bugs such as the lack of proper support for jsonschema's oneOf, it seems worthwhile to generate with master once again. Other repositories which copy internal/ci all depend on cuelang.org/go in go.mod, so the `go run` without a version should do the right thing. For any of them that don't, like Unity, they can use the cue_cmd tag. The main change is that we now handle required fields properly, as well as some other minor changes thanks to Roger's fixes. Note that the required fields change means we need to tweak cue.mod/usr. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: Ifd5796a779430c105b28f8d8a06f49457e5b0fcd Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199497 Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
cmd/cue: add test cases for embedding files inside symlink dirs This is different than embedding a symlink itself, as we follow a symlink as part of traversing a directory to open a regular file or match a glob resulting in regular files. For #3299. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: I1c02a64a442b2a1c29192a29171b0ad6a903b43e Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199041 Reviewed-by: Roger Peppe <rogpeppe@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
cue/interpreter/embed: forbid `**` via pkg/path.Match Our pkg/path.Match func mimics Go's own path.Match in that it can be used as a validator via `Match(pattern, "")`. This is better than a `strings.Contains(pattern, "**")` not only because we get consistent error messages, but also because Contains gives false positives on valid patterns such as `\**`, which escapes the first star, or `[x**y]`, where the stars are just part of a character set. Fix the code, and add more tests that demonstrate that embedding does support a glob with `\**` now. This brings embed in line with pkg/path.Match and tool/file.Glob in terms of what pattern matching syntax and features it supports. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: I0ed6fcab9426c6392fb18491a3f656f29c56b41e Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198692 Reviewed-by: Roger Peppe <rogpeppe@gmail.com> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
cmd/cue: add tests for symbolic links This adds explicit tests for the behavior of CUE when it encounters symbolic links. Namely: - symbolic links are followed for files that are directly part of the build. - symbolic links are disallowed for embedded files. - symbolic links are silently dropped when publishing modules. Modulo the fact that modules did not exist previously, this matches previous behavior (checked against v0.4.3): the non-module parts of `symlink.txtar` test pass against v0.4.3. For #3300. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: Iaf6c4668101f3e91d78a8cab5734efea0a2a9624 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198252 TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
PreviousNext