cue
cue copied to clipboard
cmd/cue: add a "relax" command
Originally opened by @mpvl in https://github.com/cuelang/cue/issues/15
When converting an overlay system to use CUE, "parent" template will often hard code defaults, about which CUE will complain if any instances unify a struct overriding such defaults. As this is likely a common case, it makes sense to add refactor support for this.
The relax command can rewrite parent structs to relax constraints. It is a simple variant of anti-unification as proposed in #7.
In a typical workflow, a user would run relax and then manually verify in the vc diffs which relaxations to keep and which reveal bugs.