Asdf: Alphabetize tool-versions

Created on 17 Sep 2020  路  6Comments  路  Source: asdf-vm/asdf

Is your feature request related to a problem? Please describe.
I am neurotic and would like plugins listed in .tool-versions to be alphabetized.

Describe the solution you'd like
When I have an existing .tool-versions file and do asdf <global|shell|local> <plugin> <version> I would like the added plugin to be alphabetized into the .tool-versions file instead of appended to the end of the file.

Describe workarounds you've considered
Currently I open the file after the fact and alphabetize it, or write the file manually and do asdf install or I ensure I install plugins in alphabetical order.

Most helpful comment

In the meantime sort .tool-versions -o .tool-versions will do the trick

All 6 comments

I recall finding myself in the obscure position where the ordering in .tool-versions mattered, so whatever solution proposed for this should also allow users to toggle the alphabetization.

I recall finding myself in the obscure position where the ordering in .tool-versions mattered, so whatever solution proposed for this should also allow users to toggle the alphabetization.

@jthegedus Mattered because of the code base it was in or mattered because it broke asdf?

I think it was because one plugin relied on a shim provided by another plugin and there was as resolution issue. I'll try and reproduce,


but as I recall:

.tool-versions:

pluignB 1
pluginA 1

B required a shim from A but tried to use the globally set version instead of the local. Doing:

pluginA 1
plguinB 1

resolved the issue.

I'm not familiar with every aspect of the asdf core codebase so could be mistaken, and this may have been an unrelated problem that I magically resolved.

In the meantime sort .tool-versions -o .tool-versions will do the trick

I don't believe we should alphabetize tools in the .tool-versions file because of this outstanding issue (I think this may be the one you were thinking of @jthegedus ) https://github.com/asdf-vm/asdf/issues/196

please don't arbitrarily reorder this file. There are dependencies. An example of this is golang and any tool that installs using go get

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johnjelinek picture johnjelinek  路  3Comments

Quintasan picture Quintasan  路  5Comments

jamesstidard picture jamesstidard  路  4Comments

ypid picture ypid  路  3Comments

Antiarchitect picture Antiarchitect  路  3Comments