asdf-vm / asdf-vm/asdf

Legacy version file opt-in by filename

Open
#1,493 4 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
25.6k
Forks
941
Avg merge
9h 24m
Merged PRs (30d)
3

Description

### Is your feature request related to a problem? Please describe

Different plugins use different legacy version files, and it may be desirable to opt into using some but not others.

For example, the `asdf-golang` plugin treats `go.mod` as a legacy version file, but for some workflows this is not desirable (see issue: https://github.com/kennyp/asdf-golang/issues/99). While I would like to opt out of using that as a legacy version file, I cannot currently do so without opting out of ALL legacy version files, including for the Go plugin (e.g., `.go-version`) and for other plugins (e.g., `.nvmrc`).

It would be nice to be able to opt out of specific legacy file versions.

### Describe the proposed solution

I don't have super strong opinions on the configuration, but a couple of options:

1. Allow `legacy_version_file` to accept `yes`, `no`, or a comma-separated list of version files:
```
legacy_version_file = .go-version,.nvmrc
```

2. Create a new configuration field to opt-out of specific version files:
```
legacy_version_file_disable = go.mod
```

### Describe similar `asdf` features and why they are not sufficient

There is currently a `legacy_version_file = yes` option, but it does not allow me to opt in or out on a per-file basis.

### Describe other workarounds you've considered

I have opened [an issue for disabling that particular legacy version file in the asdf-golang repo](https://github.com/kennyp/asdf-golang/issues/99), because it does not comply with [the asdf plugin specification](https://asdf-vm.com/plugins/create.html#optional-scripts).

Unless that is accepted, I believe my current options are:
1. Create a `.tool-versions` file in every Go project manually to ensure that `go.mod` is never used
2. Set `legacy_version_file = no` globally and disable legacy version files across all plugins

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing legacy_version_file configuration and how plugin-provided filenames such as go.mod, .go-version, and .nvmrc are selected. Compare the two proposed configuration shapes and verify behavior across the cited examples; done means users can enable or disable individual legacy files without disabling all legacy version-file handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.