cue-lang / cue

The home of the CUE language! Validate and define text-based and dynamic configuration
https://cuelang.org
Apache License 2.0
4.85k stars 279 forks source link

cmd/cue: add mod fix #3137

Closed myitcv closed 1 month ago

myitcv commented 1 month ago

We'd like a way for people to easily upgrade a legacy cue.mod/module.cue file to one that is compatible with the new syntax, including a language version.

A cue mod fix command could do this. If the file is already compatible with the new syntax, the command would have no effect. Otherwise it would add a language.version according to the language.version of the running cmd/cue binary.

This mode would also move unknown fields to a custom (bike shed name) field, by definition, as a one-off.