Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cue: add mod fix #3137

Closed
myitcv opened this issue May 10, 2024 · 0 comments
Closed

cmd/cue: add mod fix #3137

myitcv opened this issue May 10, 2024 · 0 comments
Assignees
Labels
FeatureRequest New feature or request modules Issues related to CUE modules and the experimental implementation

Comments

@myitcv
Copy link
Member

myitcv commented May 10, 2024

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.

@myitcv myitcv added FeatureRequest New feature or request modules Issues related to CUE modules and the experimental implementation labels May 10, 2024
@rogpeppe rogpeppe changed the title cmd/cue: add mod edit --fix cmd/cue: add mod fix May 10, 2024
cueckoo pushed a commit that referenced this issue May 15, 2024
This implements the core functionality required
to migrate legacy module.cue files to the new syntax.

For #3137

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I27cf3e7241d64d56398289c1400d51ef79b0f813
cueckoo pushed a commit that referenced this issue May 15, 2024
This wires up the `modfile.FixLegacy` function to a new
`cue mod fix` command.

Fixes #3137

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Idbb071493c4596feabf3b2c6c9ee8a53847d6127
cueckoo pushed a commit that referenced this issue May 15, 2024
This implements the core functionality required
to migrate legacy module.cue files to the new syntax.

For #3137

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I27cf3e7241d64d56398289c1400d51ef79b0f813
cueckoo pushed a commit that referenced this issue May 15, 2024
This wires up the `modfile.FixLegacy` function to a new
`cue mod fix` command.

Fixes #3137

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Idbb071493c4596feabf3b2c6c9ee8a53847d6127
cueckoo pushed a commit that referenced this issue May 15, 2024
This implements the core functionality required
to migrate legacy module.cue files to the new syntax.

For #3137

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I27cf3e7241d64d56398289c1400d51ef79b0f813
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194769
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest New feature or request modules Issues related to CUE modules and the experimental implementation
Projects
Status: Done
Status: v0.9.0-alpha.5
Development

No branches or pull requests

2 participants